358
The
VIC
20
User
Guide
byte
is
evaluated and truncated
to
an
integer number, if necessary.
If
byte =
1,
a branch to line number line
l
occurs.
If
byte = 2, a branch to
line number
line
2
occurs, and so on.
If
byte = 0, no branch
is
taken.
If
byte
is
in the allowed range
but
there
is
no corresponding line number in the program, then no branch
is
taken.
If
a
branch
is
not
taken, program control proceeds to the statement following
the ON-GOTO; this statement may be
on
the same line as the ON-GOTO
(separated by a colon)
or
on
the next line.
If
index has a nonzero value outside
of
the allowed range, the program
aborts with
an
error message.
As
many line numbers may be specified as will
fit
on
the 80-character line.
ON -GOTO
is
normally executed in program mode. It may be executed
in immediate mode as long as there are corresponding line numbers in the
current stored program that may be branched to.
Example:
40
AaB<10
50
ON
A+2
GOTO
100,200
50
X=)(+l
60
ON
X
GOTO
500,688,780
OPEN
Branch to statement
100
if
A
is
true
(-1)
or branch to statement 200
if
A
is/alse
(0)
Branch to statement 500
if
X=1,
statement
600
if
X=2, or to
statement
700
if
X=3. No branch
is
taken
if
X>3
The
OPEN
statement opens a logical file
and
readies the assigned
physical device.
cassette Data
File
Format
OPEN If[,dev][,sa][,'jzle name"
The file named file name on the tape cassette unit identified by dev
is
opened for the type
of
access specified by the secondary address
sa,'
the
access
is
assigned the logical file number if.
If
no file name
is
specified, the next file encountered
on
the selected tape
cassette
is
opened.
If
no device
is
specified, device number 1
is
selected by
default; this device number selects cassette unit
1.
If
no secondary address
is
specified, a default value
of
0
is
assumed
and
the file
is
opened for a read
access only. A secondary address
of
1 opens the file for a write access, while a