Application Guide

Goto labelName
specifies whichLbl commandto branch to
Because a Goto command is unconditional (it always branches to the specified label),
it is often used with an If command so that you can specify a conditional test. For
example:
If x>5
Goto GT5À
Disp x
--------
-------- Á
Lbl GT5
Disp "The number was > 5"
À
If x>5, branches directly to label GT5.
Á
For this example, the program must include commands (such as Stop) that prevent
Lbl GT5 from being executed if x{5.
Using Loops to Repeat a Group of Commands
To repeat the same group of commands successively, use one of the loop structures.
Several types of loops are available. Each type gives you a different way to exit the
loop, based on a conditional test.
Loop and loop-related commands reside on the Program Editor’s Control and Transfers
menus.
When you insert one of the loop structures, its template is inserted at the cursor
location. You can then begin entering the commands that will be executed within the
loop.
For...EndFor Loops
A For...EndFor loop uses a counter to control the number of times the loop is repeated.
The syntax of the For command is:
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.)
Getting Started with the Program Editor 499