Repetetive execution of statements - FOR … NEXT.
FOR(counter_name:text, start:number, end:number {, step:number})
Loops, while incrementing the named counter from start, until the counter is greater than end.
For each iteration 1 is added to the counter, unless the optional step parameter is specified, in which case that value is added.
When the counter passes the end value, execution continues after the NEXT
statement.
If step is negative, the loop will be iterated until the counter is less than end.
The following example scans an array of numbers and builds a set of square roots of the number in column D, checking for negative roots along the way:
FOR("i", 1, rows(@list)) IF(index(@list, 1, i) < 0) SET_VALUE(INDEX(D1:D100, 1, i), 0) ELSE SET_VALUE(INDEX(D1:D100, 1, i), SQR(INDEX(@list, 1, i))) ENDIF NEXT