Application Guide

502 Getting Started with the Program Editor
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.
The If command could also use a Goto command to transfer program control to a
specified Lbl (label) command.
Repeating a Loop Immediately
The Cycle command immediately transfers program control to the next iteration of a
loop (before the current iteration is complete). This command works with For...EndFor,
While...EndWhile, and Loop...EndLoop.
Lbl and Goto Loops
Although the Lbl (label) and Goto commands are not strictly loop commands, they can
be used to create an infinite loop. For example:
As with Loop...EndLoop, the loop should contain commands that let the function or
program exit from the loop.
Changing Mode Settings
Functions and programs can use the setMode() function to temporarily set specific
calculation or result modes. The Program Editors Mode menu makes it easy to enter
the correct syntax without requiring you to memorize numeric codes.