Loading

UNTIL

control
Configuration parameters

The UNTIL function implements an until loop. It takes two macros as arguments from the stack: the code to execute until the condition is true and the condition to evaluate after every iteration.

If one iteration takes too long (warpscript.maxloop) the loop will be killed.

Since Warp 10 2.4.0, you can force UNTIL to push an index (iteration count, start at 0) on the top of the stack before calling the macro.

UNTIL is available since version 1.0.0.

See also

Signature

Examples

5 <% // Exec macro: we duplicate the top of the stack and we decrease it by one DUP 1 - %> <% DUP 1 <= %> // Condition macro: top of the stack bigger than 1 UNTIL 'smaller or equal to 1' // Then the last number found should be smaller or equal to 1