Sharp PC-1403 Operation Manual page 164

Hide thumbs Also See for PC-1403:
Table of Contents

Advertisement

158
An
input
of 1 prints 'FIRST'; 2prints
'SECOND';
3 prints
'THI
RD'. Any
other input does not
produce
any print.
10
INPUT
A
20
ON
A GOTO
100,
200,
300
30
GOTO
900
100
PRINT
"FIRST"
110
GOTO
900
200
PRINT
"SECOND"
210
GOTO
900
300
PRINT
"THIRD"
310 GOTO
900
900
END
Examples
''Mi
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 cannot be used
in the
expressions
followi
n
g
the GOTO.
The
COMPUTER
cannot
distinguish between commas i
n expressions and
com-
mas between expressions.
1µm.1+11
The ON
...
GOTO verb
is
used to transfer control to one
of
a
set of
locations
depending
on the value of a
control
expression.
Abbreviations: 0.:
G.,
GO.,
GOT.
See
also: GOSUB, GOTO,
ON
...
GOSUB
1
ON
expression
GOTO
expression list
Where:
expression
list
is:
expression
or: expression,
expression
l
i st
Verbs
ON
... GOTO

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents