Other Content

Table Of Contents
For
variable,
À
begin,
Á
end,
Â
increment
Ã
À
Name of a variable to be used as a counter
Á
Value assigned to variable when the For loop begins.
Â
Value compared to the current value of variable at each iteration of the
loop. The loop exits when variable exceeds end.
Ã
Value added to variable at each iteration of the loop (This argument is
optional. The default increment is 1.)
At each iteration of the For loop, the variable value is compared to the end
value. If variable does not exceed end, the commands within the For...EndFor
loop are executed and the loop repeats; otherwise, control jumps to the
command following EndFor.
Note: The For command automatically increments the counter variable so that
the function or program can exit the loop after a certain number of repetitions.
At the end of the loop (EndFor), control loops back to the For command, where
the counter variable is incremented and compared to end.
For example:
For i,0,5,1
Disp iÀ
EndFor
Disp iÁ
À
Displays 0, 1, 2, 3, 4, and 5.
Á
Displays 6. When variable increments to 6, the loop is not executed.
Notes:
You can declare variable as local if it does not need to be saved after the
function or program stops.
Getting Started with the Program Editor 505