Operation Manual

Programming 13-9
8213PROG.DOC TI-82, Chapter 13, English Bob Fedorisko Revised: 02/09/01 9:25 AM Printed:
02/09/01 12:42 PM Page 9 of 18
While
While
performs a group of commands while
condition
is true.
condition
is
frequently a relational test (Chapter 2).
condition
is tested when
While
is
encountered. If
condition
is true (nonzero), the program executes a group
of commands.
End
signifies the end of the group. If
condition
is false
(zero), the program executes the commands following
End
.
While
instructions can be nested. (
PRGM CTL
item
5
)
:While
condition
:
command while condition is true
:
command while condition is true
:End
:
command
Repeat
Repeat
repeats a group of commands until
condition
is true (nonzero). It is
similar to
While
, but
condition
is tested when
End
is encountered; thus the
group of commands will always be executed at least once.
Repeat
instructions can be nested. (
PRGM CTL
item
6
)
:Repeat
condition
:
command until condition is true
:
command until condition is true
:End
:
command
End
End
identifies the end of a group of commands. Each
For
,
While
,
Repeat
, or
Else
loop must have an
End
at the “bottom,” as must a
Then
loop without
an associated
Else
. (
PRGM CTL
item
7
)