Texas Instruments TI-89 Manual Book page 316

Ti ti-89: user guide
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

Loop...EndLoop
Loops
Note: The Exit command
exits from the current loop.
Repeating a Loop
Immediately
Lbl and Goto
Loops
A
creates an infinite loop, which is repeated
Loop...EndLoop
endlessly. The
command does not have any arguments.
Loop
Typically, the loop contains commands that let the program exit
from the loop. Commonly used commands are:
Lbl
(label). For example:
An If command checks
the condition.
Exits the loop and jumps to
here when x increments to 6.
In this example, the
If
When the If command is:
At the beginning of the loop
At the end of the loop
The
command could also use a
If
control to a specified
Lbl
The
Cycle
command immediately transfers program control to the
next iteration of a loop (before the current iteration is complete).
This command works with
.
Loop...EndLoop
Although the
(label) and
Lbl
commands, they can be used to create an infinite loop. For example:
As with
Loop...EndLoop
the program exit from the loop.
:Loop
: --------
: --------
:EndLoop
:--------
:0! x
:Loop
: Disp x
: x+1! x
: If x>5
:
Exit
:EndLoop
:Disp x
command can be anywhere in the loop.
The loop is:
Executed only if the condition is true.
Executed at least once and repeated
only if the condition is true.
command to transfer program
Goto
(label) command.
,
For...EndFor
While...EndWhile
commands are not strictly loop
Goto
:Lbl START
: --------
: --------
:Goto START
:--------
, the loop should contain commands that let
Chapter 17: Programming
,
,
, and
If
Exit
Goto
, and
299

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92 plusTi-92 plus

Table of Contents