ON...GOSUB, ON...GOTO Statements Details
◄Summary► ◄Details► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
ON expression% GOSUB line-label-list
ON expression% GOTO line-label-list
Usage Notes
■ The value of expression% should be greater than or equal to 1 and less
than or equal to the number of items in the list. If the value falls
outside this range, one of the following results occurs:
Value Result
═════════════════════════════ ══════════════════════════════════
Number equal to 0 or greater Control drops to the next Visual
than number of items in list Basic statement
Negative number or number Visual Basic generates the error
greater than 255 message, "Illegal function call"
■ You can mix line numbers and labels in the same list.
■ ON...GOTO accepts a maximum of 60 line labels and line numbers.