Commodore 2001-8 User Manual page 133

Table of Contents

Advertisement

LET
ON ...GOTO
ON ...GOSUB
POKE
5 INPUT "VALUE";V
300 LET W=X
310 V=5.1
100 ON I GOTO 10,20,30,40
105 ON SGN IX)
+
2 GOTO
40,50,60
110 ON 1 GOSUB 50,60
357 POKE I,J
8·5
data was typed in than requested, the extra
data will be ignored and a warning "EXTRA
IGNORED" will be printed when this
happens. String must be input in the same
format as they are specified in DATA
statements.
Optionally types a prompt string ("VALUE")
before requesting data from the terminal.
Typing CO NT after an INPUT command
has been interrupted will cause execution
to resume at the INPUT statement.
An INPUT command is interrupted if a
carriage return is the only character
entered.
Assigns a value to a variable.
"LET" is optional. The type of variable
(numeric or string) must be the same as the
evaluated expression.
Branches to the line indicated by the I'th
number after the GOTO.
That is :
If 1= 1, THEN GOTO LINE 10
If 1= 2, THEN GOTO LINE 20
If I =3, THEN GOTO LINE 30
If I =4, THEN GOTO LINE 40.
1f
I == 0 or I attempts to select a nonexistent
line (> ==) in this case, the statement after
the ON statement is executed. However,
if I is <255 or >0, an "ILLEGAL QUANTITY"
error message will result. As many line
numbers as will fit on a 79-byte line can
follow an ON ... GOTO.
This statement will branch to line 40 if the
expression X is less than zero, to line 50 if
it equals zero, and to line 60
if
it is equal
to one.
Identical to "ON ...GOTO", except that a
subroutine called (GOSUB), is executed
instead of a GOTO. RETURN from the
GOSUS branches to the statement after the
ON ...GOSUB.
The POKE statement stores the byte
specified by its second argument (J) into
the location given by its first argument (1).

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pet 2001-8

Table of Contents