Operation Manual
13-8 Programming
8213PROG.DOC TI-82, Chapter 13, English Bob Fedorisko Revised: 02/09/01 9:25 AM Printed:
02/09/01 12:42 PM Page 8 of 18
If-Then
Then
following an
If
executes a group of commands if
condition
is true
(nonzero).
End
identifies the end of the group. (
PRGM CTL
item
2
)
:If
condition
:Then
:
command if true
:
command if true
:End
:
command
If-Then-Else
Else
following
If-Then
executes a group of commands if
condition
is false
(zero).
End
identifies the end of the group. (
PRGM CTL
item
3
)
:If
condition
:Then
:
command if true
:
command if true
:Else
:
command if false
:
command if false
:End
:
command
For(
For(
is used for looping and incrementing. It increments
variable
from
begin
to
end
, by
increment
.
increment
is optional (if not specified, 1 is
used) and can be negative (
end
<
begin
).
end
is a maximum or minimum
value not to be exceeded.
End
identifies the end of the loop.
For(
loops can
be nested. (
PRGM CTL
item
4
)
:For(
variable
,
begin
,
end
,
increment
)
:
command while end not exceeded
:
command while end not exceeded
:End
:
command
For example,
For(A,0,10,2):Disp A
2
:End
, displays
0
,
4
,
16
,
36
,
64
, and
100
.