Radio Shack TRS-80 PC-3 Owner's Manual page 152

Table of Contents

Advertisement

1
ON
expression
GOTO
expression list
Where: expression list
is:
expression
or:
expression, expression list
Abbreviations: 0., G., GO., GOT.
See also:
GOSUB, GOTO,
ON . ..
GOSUB
Purpose
The ON ... GOTO verb is used to transfer control to one of a set of locations, depend ing on the value of a control expression.
Use
When the ON ... GOTO verb is executed, the expression between ON and GOTO is evaluated and reduced to an integer. If the
value of the integer is 1, control is transferred to the first location in the list. If the expression is 2, control is transferred to the
second location in the list, and so forth.
If the expression is zero, negative, or larger than the number of locations provided in the list, execution proceeds with the next
line of the program.
NOTE: Commas may not be used in the expressions following the GOTO. The Computer can not distinguish between commas
in expressions and commas between expressions.
152

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents