Commodore PET User Manual page 151

Table of Contents

Advertisement

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
defau Its 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-
dress code defau Its 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#
1
r
Logical file number established by OPEN statement
INPUT#
~
GET#
file ...
CMD
L
CLOSE
Other parameters (if any)
138

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cbm

Table of Contents