GOSUB - source-solutions/HELP GitHub Wiki
GO[ ]SUBline_number [anything]
Jumps to a subroutine at line_number
. The next RETURN
statement jumps back to the statement after GOSUB
. Anything after line_number
until the end of the
statement is ignored. If executed from a direct line, GOSUB
runs the subroutine and the following RETURN
returns execution to the direct line.
-
line_number
is an existing line number literal. - Further characters on the line are ignored until end of statement.
- If no
RETURN
is encountered, no problem. - One optional space is allowed between
GO
andSUB
; it will not be retained in the program.
- If
line_number
does not exist: Undefined line number. - If
line_number
is greater than65529
, only the first four characters are read (for example,6553
).