Application Guide

500 Getting Started with the Program Editor
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.
You can set end to a value less than begin, provided you also set increment to a
negative value.
While...EndWhile Loops
A While...EndWhile loop repeats a block of commands as long as a specified condition
is true. The syntax of the While command is:
While condition
When While is executed, condition is evaluated. If condition is true, the loop is
executed; otherwise, control jumps to the command following EndWhile.