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

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

Advertisement

DISK BASIC
198
INPUTMODE
<L
0,
R)
H
;
MODE*
110 INPUT"BUFFER
NUMBER";
BUFFERS
129 INPUT'TILE SPECIFICATION"; FILESPEC*
136 OPEN
MODE*,
BUFFER'/.,
FILESPEC*
This
sequence of
statements
lets
you
provide the
arguments
for
the
OPEN
statement during
program
execution.
The
first
character
of
MODES
sets
the
access
mode,
BUFFER%
determines
which
buffer
will
be
used,
and
FILESPEC
$ gives
the
file
specification.
QPEN
,,
R
M
,
2,
"DATA/BAS.
SPECIAL"
Opens
the
file
DATA/BAS
with password
SPECIAL,
in
the
random
I/O
mode,
using buffer
number
2.
If
DATA/BAS
does not
exist,
it
will
be
created
on
the
first
non
write-protected
drive.
While
a
file
is
open,
it is
referenced
by
the
buffer-number
which was
assigned to
it.
Examples:
GET
buffer-number
PUT
buffer-number
PRINT
^buffer-number
INPUT
#
b
uffer-n
umber
All
these
statements
will
reference the
file
which was
OPENed
via
buffer-number
.
The
mode
must
be
correct.
Once
a
buffer has
been
assigned to
a
file
with
the
OPEN
statement,
that
buffer
cannot be used
in
another
OPEN
statement.
You
have
to
CLOSE
it
first.
More
on
Buffer
Assignments
Two
or
more
buffers
may
be
assigned to the
same
file
for
sequential
input (I-mode).
However,
only
one
buffer
at
a
time
may
be
assigned
to a
file
for sequential
output
(O-mode)
or
random
access
R-mode.
For
example:
10 OPEN
" I
M,
TEST/TXT
:i"
20 OPEN
"
I
",
2,
"TEST/TXT
:
1"
Now
TEST/TXT
can be
accessed
via
buffers
1
and
2
for
sequential
input.
7-35

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents