EasyManua.ls Logo

Commodore CBM - Page 151

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...
s
device
where:
file
is
the logical file number and may
be
any num-
ber. variable or expression in the range 1
through 255. The logical file number
must
be
present in
an
OPEN
statement.
is
the physical device number and may
be
any
number. variable or expression in the range 0
through 30. If omitted. the device number
defauIts
to
1.
the console tape unit.
is
the secondary address code. This parameter
may
be
any number. variable. or expression in
the range 0 through
31
that
is
valid for the
specified device. If omitted. the secondary ad-
d
ress
code defauIts to
O.
filename
is
a string enclosed in quotes or a string variable
representing a file name.
On
the
PET.
a logical file number
is
the
way
of referring to a particular opera-
tion on a particular portion of a particular 1/0 unit. The particular operation
is
specified by the secondary address code; subsequent 1/0 statements for the file
must
conform
to
the secondary address code specification. For example. vou can-
not
open a file for read and then try
to
write
to it. The particu lar 1/0
unit
is
specified by the device number. The particular portion of the device
is
specified
by the filename. The relationships between logical file number. physical device
number. secondary address code. and file name are illustrated in Figure 4-1.
Logical File Number
The
PET
performs programmed
input/output
(1/0)
operations via logical file
designations. A logical file
must
be
opened for each type of 1/0 operation to
be
performed on each device accessed. The
OPEN
statement specifies the particular
type of operation
to
be
performed via the logical file. Subsequent 1/0 operations
ail refer
to
the logic file number set up by the
OPEN
statement:
PRINT# 1r Logical file number established by
OPEN
statement
INPUT#
~
GET#
file
...
CMD
L
CLOSE
Other parameters (if any)
138

Table of Contents

Other manuals for Commodore CBM

Related product manuals