Hey, the for... to loop does everything I, more or less humbly , asked for (and still keeping what other people wanted!).
To be honest, I have to report that it does have a tiny flow, but probably nobody will stumble on it, so I won't tell more. (Otherwise you guys would fix it and I certainly do not want that .)
mP 602 release
Re: mP 602 release
Please, let us know of the problem. It will be found in mB too otherwise. mikroBasic users are almighty, they find everything. Furthermore, let us fix the problem forever.
Should have kept my mouth shut.
Still, I do not think it's a real problem and it should be enough to mention it in help, so please, please leave it as it is.
OK, I'm digging my own grave but here it goes. Such a loop will run forever:
Note that it does not make sense at first look to use such a construct (so probably nobody will), but if you use something like this:then you may check if and when execution of the loop was discontinued by checking the counter. Normal execution will end with i=k+1. Abnormal, caused by break command will give i=0..k.
If I may suggest, place this code in help as an educational example (which will make the behaviour intentional ). Then place a warning that trying to countinue the loop above counter's range results in infinite loop and nobody would even have a right to complain.
BTW the help still contains the statement:
Still, I do not think it's a real problem and it should be enough to mention it in help, so please, please leave it as it is.
OK, I'm digging my own grave but here it goes. Such a loop will run forever:
Code: Select all
var i:byte;
for i:=250 to 255 do
begin
if i=255 then continue;
end;
Code: Select all
k:=50;
for i:=0 to k do
begin
if 'logical expression' then break;
if i=k then continue;
end;
If I may suggest, place this code in help as an educational example (which will make the behaviour intentional ). Then place a warning that trying to countinue the loop above counter's range results in infinite loop and nobody would even have a right to complain.
BTW the help still contains the statement:
The for statement results in an endless loop if the final_value equals or exceeds the range of counter’s type.