20060301
U
s
ing Subroutine
s
Including the name of another program file inside of a program causes execution to jump
to the specified program file. The program that execution jumps from is called the “main
program”, while the program to which execution jumps is called a “subroutine”.
When program execution returns to the main program, it resumes from the point immediately
after the command that jumped to the subroutine.
Tip
• Note that any program can be a subroutine. The thing that makes any program a subroutine is
being jumped to from another program.
Main
Program
Subroutines
Level 1
Level 2 Level 3 Level 4
Subroutines can be used in a variety of ways to help make calculations easier. Let’s say
you have a formula that needs to be calculated more than once in a program, or that needs
to be calculated by a number of different programs. Simply store the formula as a separate
program file (subroutine), and then you can jump to the program file that contains the formula
whenever you need it.
12-2-8
Creating a New Program
D
C
E
I
J
E ( )
I ( )
J ( )
A
D ( )
C ( )
I\
Local Variable
s
A local variable is a variable that can be created temporarily and used in a program. Use the
Local
command to create a local variable.
Syntax:
Local
:
<variable name> (
:
indicates a space.)
Example:
Local abc
The above creates a local variable named “abc”.
Tip
• Local variables are deleted automatically after execution of a program is complete.
• Note that local variables are stored in their own special folder, so local variable names do not
affect the names of other variables in ClassPad memory. Because of this, you do not need to
worry if you assign a local variable a name that is already being used by another type of variable.
• Variables that are specified as parameter variables within a program are automatically treated
as local variables. Variables created with the
Define
command are also automatically treated as
local variables.
Summary of Contents for ClassPad 330
Page 11: ...20060301 20090601 ClassPad 330 ClassPad OS Version 3 04 ...
Page 277: ...20060301 3 3 10 Storing Functions 3 Tap AND Plot OR Plot ...
Page 779: ...20090601 S Graph Line Clustered C S Graph Line Stacked E 13 9 2 Graphing ...
Page 780: ...20090601 S Graph Line 100 Stacked F S Graph Column Clustered G 13 9 3 Graphing ...
Page 781: ...20090601 S Graph Column Stacked I S Graph Column 100 Stacked J 13 9 4 Graphing ...
Page 782: ...20090601 S Graph Bar Clustered K S Graph Bar Stacked 9 13 9 5 Graphing ...