NAME
ON...GOSUB, ON...GOTO Statements
SYNOPSIS
ON expression% GOSUB line-list
ON expression% GOTO line-list
o expression% An expression in the range 0 through 255.
o line-list A set of labels or line numbers. If the value of the
expression is 1, the program branches to the first line
in the list; if the expression is 2, it branches to the
second line, and so on.
o SELECT CASE provides a better way to perform multiple branching.
DESCRIPTION
Branch to one of several locations, depending on the value of an expression.
Example:
FOR i% = 1 TO 2
ON i% GOSUB One, Two
NEXT i%
END
One: PRINT "One"
RETURN
Two: PRINT "Two"
RETURN
SEE ALSO
ON SELECT CASE