EasyManua.ls Logo

Commodore CBM - Open

Commodore CBM
447 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
The specified index
is
evaluated and, if necessary, truncated to
an
integer
number. If
index=l,
a branch
is
taken to the statement
with
line number
linel'
If
index=2, a branch
is
taken to the statement
with
line number line2. If index=3, a
branch
is
taken to the statement
with
line number line3' If index=O, no branch
is
taken. If index
is
in the allowed range but there
is
no corresponding line number in
that position of the line number
list
no branch
is
taken. If a branch
is
not
taken,
program control proceeds to the next statement
following
the
ON
...
GOTO.
The
next statement may
be
on
the same line
as
the
ON
...
GOTO
(separated by a co-
lon).
If index has any value other than zero outside the allowed range, the pro-
gram aborts
with
an
error message. As many line numbers may
be
specified
as
will
fit
on
the SO-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:
OPEN
40
A=B<
10
50
ON
A+2
GOTO
100,200
50
X=X+l
60
ON
X
GOTO
500,600,700
70
Branch to statement 100 if A
is
true
(-1)
or branch to statement 200 if A
is
false
(0).
Branch to statement 500
if
X=l,
to 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.
Format:
OPEN
file
file,device
file,device,s
fi le.device.s,fi lename
Open code 0 of device 1
and assign file.
Open code 0 of device and
assign file.
Open code s of device and
assign file.
Open filename, code
s,
of
device and assign file.
137

Table of Contents

Other manuals for Commodore CBM

Related product manuals