FOR


control
Since v1.0.0
Available on all platforms
See also

Configuration parameters


The FOR function implements a for loop. It takes three arguments from the stack : the initial and the final values of the loop index and a macro to be executed at each iteration.

For each iteration the loop index is put on top of the stack, and the exec macro is then called.

Signature

Examples

// Macro that squares the value on the top of the stack <% 2 ** %> 'SQUARE' STORE // FOR from i=1 to i=10 generate i^2 1 10 $SQUARE FOR