Other Content

Table Of Contents
Â
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:
0&x
Loop
Disp x
x+1&x
If x>5À
Exit
EndLoop
Disp x Á
À
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.
In this example, the If command can be anywhere in the loop.
When the If
command is:
The loop is:
At the beginning of
the loop
Executed only if the condition is true.
At the end of the loop Executed at least once and repeated only if the
condition is true.
Getting Started with the Program Editor 507