696
Programming
To test for each option (If Choice=1, If Choice=2, and so on), use the
If...Then...ElseIf...EndIf
structure.
Lbl and Goto commands
You can also control the flow by using
Lbl
(label) and
Goto
commands.
These commands reside on the Program Editor’s
Transfers
menu.
Use the
Lbl
command to label (assign a name to) a particular location in
the function or program.
You can then use the
Goto
command at any point in the function or
program to branch to the location that corresponds to the specified
label.
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, 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.
Lbl
labelName
name to assign to this location (use the
same naming convention as a variable
name)
Goto
labelName
specifies which
Lbl
command to
branch to
If x>5
Goto GT5
À
Disp x
--------
--------
Á
Lbl GT5
Disp "The number was > 5"
Summary of Contents for TI-Nspire
Page 38: ...26 Setting up the TI Nspire Navigator Teacher Software ...
Page 46: ...34 Getting started with the TI Nspire Navigator Teacher Software ...
Page 84: ...72 Using the Content Workspace ...
Page 180: ...168 Capturing Screens ...
Page 256: ...244 Embedding documents in web pages ...
Page 336: ...324 Polling students ...
Page 374: ...362 Using the Review Workspace ...
Page 436: ...424 Calculator ...
Page 450: ...438 Using Variables ...
Page 602: ...590 Using Lists Spreadsheet ...
Page 676: ...664 Using Notes You can also change the sample size and restart the sampling ...
Page 684: ...672 Libraries ...
Page 714: ...702 Programming ...
Page 828: ...816 Data Collection and Analysis ...
Page 846: ...834 Regulatory Information ...
Page 848: ...836 ...