Operation Manual

13-18 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 18 of 18
Calling Other Programs
On the TI
.
82, any program can be called from another program as a subroutine.
Enter the name of the program to use as a subroutine on a line by itself.
Calling a Program from Another Program
To call one program from another, begin on a blank line in the program
editor and do one of the following:
¦
Press
|
to display the
PRGM EXEC
menu and select the name of
the program.
prgm
and the name are copied to the current cursor
location.
¦
Select
prgm
from the
PRGM CTL
menu and then type the letters of the
program
name
(page 13
.
11).
prgm
name
When this instruction is encountered during execution, the next command
that the program executes is the first command in the second program. It
returns to the subsequent command in the first program when it encounters
either a
Return
instruction or the implied
Return
at the end.
PROGRAM:VOLCYL
PROGRAM:AREACIRC
:Prompt D
:D
à
2
!
R
:Prompt H
:
π
R
2
!
A
:prgmAREACIRC
:Return
:A
H
!
V
:Disp V
Notes about Calling Programs
Variables are global.
label
used with
Goto
and
Lbl
is local to the program in which it is located.
label
in one program is not “known” by another program. You cannot use
Goto
to branch to a
label
in another program.
Return
exits a subroutine and returns to the calling program, even if
encountered within nested loops.