EXAMPLE: GOSUB 100
GOSUB #6
GOSUB *Root
PARAMETERS:
1. Branch destination line number: integer in the range of 1≤ line number ≤65535
2. Program area number: single character, 0-9
3. Label: Name of a label in the program.
EXPLANATION:
1. Program execution branches to the subroutine that starts at the specified line
number or label. Execution is returned from the subroutine by the RETURN
statement.
2. Subroutines can be nested up to 96 levels. Exceeding this value results in an
“OM error”
3. An “UL error” is generated when the specified line number or label name does
not exist.
4. CLEAR command cannot be used within a subroutine.
SEE: RETURN
RETURN
PURPOSE: Returns execution from a subroutine to the main program.
FORMAT: RETURN
EXAMPLE: RETURN
EXPLANATION:
1. Returns program execution to the statement immediately following the
statement that originally called a subroutine.
2. A “GS error” is generated when the RETURN statement is executed without
first executing a GOSUB statement.
SEE: GOSUB, ON GOSUB