The EGL keyword for begins a statement block that runs in a loop for as many times as a test evaluates to true. The test is conducted at the beginning of the loop and indicates whether the value of a counter is within a specified range. The keyword end marks the close of the for statement.
If you specify decrement, finish is the lower limit of counter; and if the value of counter is below that limit, the test resolves to false, the statement block is no longer executed, and the for statement ends.
EGL statements in the for statement can change the value of finish.
If you specify decrement, delta is the value subtracted from counter after the EGL statement block is executed and before the value of counter is tested.
EGL statements in the for statement can change the value of delta.
An example is as follows:
sum = 0; // adds 10 values to sum for (i from 1 to 10 by 1) sum = inputArray[i] + sum; end
Related reference
EGL statements
Related tasks
Syntax diagram for EGL statements and commands