Skip a step in a loop
This functionality does not run in MATLAB.
The next statement is equivalent to the function call _next(). The return value is the void object of type DOM_NULL.
Inside for, repeat, and while loops, the next statement interrupts the current step of the loop. In for statements, the loop variable is incremented and execution continues at the beginning of the loop. Similarly, the control conditions at the beginning of a while loop and in the until clause of a repeat loop are verified, before execution continues at the beginning of the loop.
In the following for loop, any step with even i is skipped:
for i from 1 to 5 do if testtype(i, Type::Even) then next end_if; print(i) end_for:
In the following repeat loop, all steps with odd i are skipped:
i := 0: repeat i := i + 1; if testtype(i, Type::Odd) then next end_if; print(i) until i >= 5 end_repeat: