0
Drop out of a FOR loop early
Is there a BREAK command word to stop a loop - when a condition is met prior to cycling thru all the items in the loop? Can't seem to find a way to make it work without using a WHILE loop instead.
3 replies
-
Once the condition is met, set your loop variable to a value greater than your maximum loop value.
-
The only way I figured out how to do this is to have use the else statement.
If x=1 then do......
else
do......
-
Yeah, it my solution only works for this style...
let count := 0;
for i from 0 to 10 do
count := count + 1;
i := 20
end;
count
Content aside
- 4 yrs agoLast active
- 3Replies
- 1886Views