Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
ON...GOSUB, ON...GOTO Statements
◄Summary► ◄Details► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
Branches to one of several specified lines, depending on the value of an
expression. For a more powerful, convenient, and flexible way to do multiple
branches, use the SELECT CASE statement.
ON expression% GOSUB line-label-list
ON expression% GOTO line-label-list
■ expression% Any numeric expression in the range 0 to 255,
inclusive
■ line-label-list Set of labels or line numbers; if the value of
expression% is 1, the program branches to the first
line in the list; if expression% is 2, the program
branches to the second line, and so on
See Also
◄Loops and Decision Structures► ◄SELECT CASE Statement►