advr.hlp (Topic list)
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 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.