Chapter
10
I
BASIC
Keywords
OPEN
Statement
OPEN
mode,[
#]buffer,[pathname][dev:][,record
length]
OPEN
[pathname][dev:l
[FOR
model
AS
[#]buffer
[LEN
=
record
length1
Establishes an input/output path
for
a file
or
device.
Buffer
is an integer in the range
1
to
15.
It
specifies the 110
buffer in memory
to
use when accessing the file. The number
sign
(#)
is optional.
It
is
provided
for
compatibility with other
BASICs.
Pathname
is a standard file specification as described in Chapter
1.
If you omit
pathname,
you must include
deu:.
deu:
specifies the device
to
be opened for communication.
Record
length
is an integer in the range
1
to
32768
that sets the
record length for direct access files. If you omit
record
length,
BASIC assumes
a
default record length of
128
bytes.
Do
not
use
this option with sequential access files.
Mode
specifies any of the following:
0
or
OUTPUT
I
or
INPUT
A
or
APPEND
R
or
RANDOM
sequential output mode
sequential input mode
sequential output and extend mode
direct inputloutput mode
In the first form
of
the syntax, you must use the abbreviated
form of
mode,
and
it
must be enclosed in quotation marks.
In the second form of the syntax, you must specify the complete
word
for
mode.
You may not specify RANDOM. If you want
to
use direct access in the second form of the syntax, omit
mode.
242