Skip to content
Andrew Owen edited this page May 30, 2023 · 2 revisions

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).

Welcome to the SE BASIC wiki


  • Press RETURN to return to this menu.
  • Enter the name of a TOPIC to display it.
  • Enter EXIT to return to BASIC.

Choose from the following topics:

  1. Quick start guide: QUICK
  2. User's guide: USER
  3. Configuration guide: CONFIG
  4. Language guide: LANGUAGE
  5. Language reference: BASIC
  6. Technical reference: TECH
  7. Developer's guide: DEV
  8. Acknowledgemets: CREDITS
  9. Licenses: LICENSE
Clone this wiki locally