20060301
Example 1:
Jumping to a subroutine without assigning values to the subroutine’s parameter
variables
Main Program
Input A
Input B
Sub1( )
k
Jumps to subroutine program “Sub1”
Print C
Subroutine (Program Name: “Sub1”)
A+B
2
C
Return
Example 2:
Jumping to a subroutine while assigning values to the subroutine’s parameter
variables
• In this example, the main program assigns values to parameter variable “E” in a subroutine
named “Sub1”, and to parameter variables “F” and “G” in a subroutine named “Sub2”.
Main Program
Input A
Input B
Sub1(A)
k
Assigns the value of main program variable “A” to the
parameter
variable (E) in
subroutine “Sub1”, and then jumps to subroutine “Sub1”.
Print C
Sub2(A,B)
k
Assigns the values of main program variables “A” and “B” to the
parameter
variables (F and G) in subroutine “Sub2”, and then jumps to subroutine “Sub2”.
Print D
Subroutine Program 1 (Program Name “Sub1”)
E
s
2
2
C
k
Requires input of variable name E into the parameter variable box.
Return
Subroutine Program 2 (Program Name “Sub2”)
F + G
2
D
k
Requires input of variable names F and G into the parameter variable box.
Return
Tip
• The subroutine does not need to be located in the current folder. To specify a subroutine named
“Sub1” that is located in a folder named “f1”, for example, you would specify “f1\Sub1( )”.
12-2-9
Creating a New Program
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 ...