Texas Instruments TI-80 Calculator User Manual


 
Programming 10-7
PRGM CTL (program control) instructions are accessed only from within the
program editor. They direct the flow within an executing program, making it easy
to repeat or skip commands during program execution. While the program editor
is displayed, press
K
. The selected menu item is copied to the cursor
location.
CTL I/O EXEC
1:IF
Creates a conditional test.
2:THEN
Used with
IF
.
3:ELSE
Used with
IF-THEN
.
4:FOR(
Creates incrementing loop.
5:END
Signifies end of loop,
IF-THEN
, or
ELSE
.
6:PAUSE
Pauses program execution.
7:LBL
Defines a label.
8:GOTO
Goes to a label.
9:PRGM_
Executes a program as a subroutine.
0:RETURN
Returns from a subroutine.
A:STOP
Stops program execution.
Program control instructions tell the TI
-
80 which command to
execute next in a program.
IF
checks a condition that you
define to determine what command to execute next. The
condition frequently uses relational tests (Chapter 2), such as
IF A<7:A+1
!
A
.
IF
(
PRGM CTL
, item 1) is used for testing and branching. If the
condition is false (zero), the command immediately following
IF
is skipped. If the condition is true (nonzero), that command
is executed.
IF
instructions can be nested.
:IF
condition
:
command if true
:
command
PRGM CTL (Control) Instructions
PRGM CTL
Menu
Controlling
Program Flow
IF