GOSUB - source-solutions/HELP GitHub Wiki

GOSUB


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.

Parameters

  • line_number is an existing line number literal.
  • Further characters on the line are ignored until end of statement.

Notes

  • If no RETURN is encountered, no problem.
  • One optional space is allowed between GO and SUB; it will not be retained in the program.

Errors

  • If line_number does not exist: Undefined line number.
  • If line_number is greater than 65529, only the first four characters are read (for example, 6553).
⚠️ **GitHub.com Fallback** ⚠️