Radio Shack TRS-80 Trsdos & Disk Basic Reference Manual page 120

Micro computer system
Hide thumbs Also See for TRS-80:
Table of Contents

Advertisement

DISK BASIC
OPEN
(Assign a
buffer
to
a
file
and
set
mode)
OPEN
expl$,nmexp,exp2$
where expl$
is
a
string
expression or constant of
which
only the
first
character
is
significant; this
character
specifies
the
mode
in
which
the
file
is
to
be opened:
expl$-
access
mode
I
O
R
sequential
input
sequential
output
random
I/O
nmexp
has
a
value
from
1
to
15,
and
tells
BASIC
which
buffer to
assign
to the
file
specified
by exp2$
exp2$
defines
a
TRSDOS
file
specification
This statement
makes
it
possible to access a
file.
expl$
determines
what
kind of
access you'll
have
via
the
specified buffer;
nmexp
determines
which
buffer
will
be
assigned to the
file;
and
exp2$ names
the
file
to
be
accessed.
If
exp2$
does not
exist,
then
TRSDOS
may
or
may
not
create
it,
depending
on
the
access
mode.
Note:
nmexp
(buffer
number)
cannot exceed
the
number you
entered
for
the
FILES?
question during
initialization. If
you
entered:
HOW MANY FILES? Z
then
nmexp
can have
the value
1
or
2.
Examples
of
OPEN
statements:
160 OPEN
"OM,
"CLIENTLS/TXT"
Opens
the
file
"CLIENTLS/TXT"
for
sequential output.
Buffer
1
will
be
used.
If
the
file
does not
exist,
it
will
be
created.
If
it
already
exists,
then
its
previous contents
are
lost.
(This
is
explained
under
"Sequential I/O Techniques".)
100 OPEN
"1M
"PROGl/TXT:!"
Opens
the
file
"PROG
1
/TXT"
on
drive
1
for
sequential input.
Buffer
|
is
assigned to the
file.
If
PROG
1
/TXT
does not
exist
on
drive
1,
an
error
message
is
returned
since
you
can't
input
from
a
non-existent
file!
7-34

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents