• 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.
Main routine
Main routine
Subroutine
1st level 2nd level, 3rd level
Subroutine
Subroutine
Subroutine
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
-53-