Using Loops To Repeat A Group Of Commands; For - Texas Instruments TI-NSPIRE Software Manual

Cas computer software
Hide thumbs Also See for TI-NSPIRE:
Table of Contents

Advertisement

You can then use the
program to branch to the location that corresponds to the specified
label.
labelName
Goto
Because a
Goto
specified label), it is often used with an
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
) that prevent
Stop

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
and
menus.
Transfers
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
loop uses a counter to control the number of times the
For...EndFor
loop is repeated. The syntax of the
Note: The ending value can be less than the beginning value, provided
the increment is negative.
Programming
command at any point in the function or
Goto
Lbl
specifies which
command is unconditional (it always branches to the
À
GT5 from being executed if x{5.
Lbl
command to branch to
command so that you can
If
command is:

For

Control
337

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-nspire

Table of Contents