Casio PB-100 Instruction Manual page 54

Table of Contents

Advertisement

• Nesting
Similar to the FOR*NEXT statement, GOSUB statements can also be stacked. The
number of times the subroutine is i:alled out is fixed.
This nesting can be performed up to 8 levels. Therefore, a subroutine can be called out
from a subroutine.
M a i n r o u t i n e
M a i n r o u t i n e
S u b r o u t i n e
1st level 2nd level, 3rd level
S u b r o u t i n e
S u b r o u t i n e
S u b r o u t i n e
In this example, the subroutines
are not stacked so you can use
as many as you like.
This example shows three levels of
nesting. Up to 8 levels can tje stacked.
A subroutine is convenient for assembling common portions of a main routine in order
to save the number of steps or for assembling portions separately as subroutines when
assembling a complicated program.
0
- 5 3 -

Advertisement

Table of Contents
loading

Table of Contents