Appendix
G:
BASIC
Statements 359
secondary address
of
2 opens the file for a write access with
an
end-of-tape
mark written when the file
is
subsequently closed.
Example:
OPEN
1
OPEN
1.1
OPEN
1.1,O
OPEN
1.1,0,"DAT"
OPEN
3.1.2
OPEN
3.
1.2.
"PENTAORAM"
Disk
Data
File
Format
Open logical file 1 at cassette drive
#1
(default)for a read access (default)
from
the first file encountered on the
tape (no file name specified)
Same
as
above
Same
as
above
Same
as
above
but
access the file named
DAT
Open logical file 3
for
cassette
#1
for
a
write with
EOT
(End
Of
Tape)
access. The new file is unnamed
and
will be written at the current physical
tape location
Same as above
but
access the file named
PENTAGRAM
OPEN /f,dev,sa, "dr;file name,type[,access]"
The file named file name
on
the diskette in drive dr
is
opened and
assigned logical file number
If
type identifies the file as sequential (SEQ),
program (PRG),
or
random
(USR).
If
the file
is
sequential, access must be
WRITE
to specify a write access
or
READ
to
specify a read access. Access
is
not present for a program
or
random access file.
An existing sequential file can be opened for a write access
if
dr
is
preceded by
an
@ sign. The existing sequential file contents are replaced
entirely by new written data.
The device number
dey must be present; it
is
8 for all standard disk
units.
If
dey
is
-absent, a default value
of
I
is
assumed
and
the primary tape
cassette unit
is
selected.
For
a
data
file the secondary address
sa
can have any value between 2
and
14,
but
every open
data
file should have its own unique secondary
address. A secondary address
of
15
selects the disk unit command channel.
Secondary addresses
of
0 and 1 are used to access program files. Secondary
address 0
is
used
to
load a program file; secondary address 1 is used to save a
program file.