FOR

NAME

for - Used to loop until a certain condition is met.

SYNOPSIS

for (i=0;i<10;i+=2) do … endfor

for i in variable do …endfor

for i function(…) do … endfor

DESCRIPTION

In the first form, the "for function" is used to loop until the condition is met. The first part is the initialization. The second part is the test and the third part is done at the end of the loop before the condition. ( and ) are mandatary.

In the second form, the "for function" is used to loop for each elements of the variable.

In the third form, the "for function" is used to loop until the function returns "false". At each iteration, the result of the function is returned and put in the variable i.

The loop initializes variables:

EXAMPLES

Note: In the followings examples, the _ between the { should be removed to make it work.

res={_{for i in [1,2,4] do " nb="; sn_nb; " i="; i; endfor}}. return
        res= nb=0 i=1 nb=1 i=2 nb=2 i=4.

SEE ALSO

AUTHOR

Written by Pierre Laplante and Caroline Laplante, <laplante@sednove.com>

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com