English
Language : 

NSB8 Datasheet, PDF (57/158 Pages) List of Unclassifed Manufacturers – BASIC interpreter for Z80 family
ITALIAN TECHNOLOGY
grifo®
ON
STATEMENT:
ON <numeric expression> GOTO <list of line numbers>
ACTION:
The numeric expression is used to choose a single number from the list of line numbers. Then, as with
GOTO, execution is immediately transferred to the line with the chosen number.
EXAMPLES:
10 ON C GOTO 100, 200, 300, 400
105 ON X-10 GOTO 10, 20, 30, 40, 50, 60, 70
REMARKS:
The numeric expression must evaluate to a quantity greater or equal to 1. There may be as many line
numbers in an ON…GOTO statement as will fit on a program line.
The first line number in the list will be chosen if the expression evaluates to 1, the second if it reduces
to 2, the twentieth if it equals 20, and so on. For example, in statement 10 above, if the value of C
is 3, then the result will be the same as GOTO 300. An ON…GOTO statement with N line numbers
in its list will work for integer values from 1 to N.
ERROR MESSAGES:
SYNTAX ERROR
This can happen with ON…GOTO because the numeric expression, when truncated, evaluated to
an integer less than 1 or greater than the number of line numbers in the list.
TYPE ERROR
The expression specified was not a numeric expression.
LINE NUMBER ERROR
OUT OF BOUNDS ERROR
See statement GOTO
SEE ALSO:
Statement GOTO
NSB8
Rel. 5.10
Page 45