ON


Language statement ON


10
20  ON GOTO|GOSUB label1 [, …, labelN]
30
Causes a branch to one of a list of labels.


See examples


If there is insufficient information on this page and you wish learn more about ON, please send an email to smallbasic@gmail.com. You can help to improve information about ON by submitting an article using the comments link below. Note, an offline language reference text file is now avialable – see the Download section.

A numeric expression in the range 0 to 255. Upon execution of the ON…GOTO command (or ON…GOSUB), BASIC branches to the nth item in the list of labels that follows the keyword GOTO (or GOSUB).