Specifications

Commands - 75
ON
Statement
SYNTAX: ON expression GOSUB line [,line] ...
ON expression GOTO line [,line] ...
PURPOSE: In the ON...GOTO statement, the value of the expression determines which line number in the list
will be used for branching. For example, if the value is 3, the third line number in the list will be the
destination of the branch.
NOTE: You may not use labels with this statement.
REMARKS: In the ON...GOSUB statement, each line number in the list must be the first number of a subroutine.
If the value of the expression is zero, the statement is ignored.
RELATED: RETURN
EXAMPLE: 200 ON R GOTO 150,300,320,390
If R=1, the program goes to line 150
If R=2, the program branches to line 300 and continues from there. If R=3, the branch will be to
line 320 and so on.
ERROR: <Can’t compile> – if line does not exist
<Data negative> – for expression
<Data > 255> – for expression