Programming 699
À Initially sets x.
Á Displays 0, 1, 2, 3, and 4.
 Increments x.
à Displays 5. When x increments to 5, the loop is not executed.
Loop...EndLoop loops
A Loop...EndLoop creates an infinite loop, which is repeated endlessly.
The
Loop command does not have any arguments.
Typically, you insert commands in the loop that let the program exit from
the loop. Commonly used commands are:
If, Exit, Goto, and Lbl (label).
For example:
À An If command checks the condition.
Á Exits the loop and jumps to here when x increments to 6.
Note: The
Exit command exits from the current loop.
0&x À
While x<5
Disp x
Á
x+1
&x Â
EndWhile
Disp x
Ã
Loop
--------
--------
EndLoop
--------
0&x
Loop
Disp x
x+1
&x
If x>5
À
Exit
EndLoop
Disp x
Á