Download Print this page

Radio Shack TRS-80 model III Owner's Manual page 138

Mini-disk operation, trsdos disk operating system, disk basic programming language
Hide thumbs Also See for TRS-80 model III:

Advertisement

DISK
BASIC
The
"current record"
is
the
record
whose number
is
one
higher than
that
of
the
last
record accessed.
The
first
time
you
access
a
file
via a particular buffer, the
current record
is
set
equal
to
1
For example:
Program
statement
Effect
1000OPEN"R
,
\l,
t
'NAME/BAS'
1010
FIELD
1,...
1020
GET
1
1025
REM.
..ACCESS
BUFFER
1030
GET
1,30
1035
REM...
ACCESS BUFFER
1040
GET
1,25
1046
REM...
ACCESS BUFFER
1050
GET
1
Open
name/bas
for
random
access
using buffer
1
Structure buffer
get
record
1
into
buffer
1
get
record
30
into
buffer
1
get
record 25
into
buffer
1
get
record
26
into
buffer
1
If
you
are
using variable-length records
(not fixed-length),
an attempt
to
get
past the
end
of
file
will
produce
an
error.
If
you
are
using fixed-length
records, the
same
attempt
will
return a
null
record
and no
error will occur.
To
prevent
this
from
occurring,
you
can use
the
lof
function
to
determine
the
number
of
the
highest
numbered
record.
PUT
Write a
Record
to
Disk
Random
Access
pmmmp1hnmxfi2l
rt/ite^$peeiiles a
random
access
file
buffer,
nmexp-
1
^.;>ilv
nmmp2^e$i&$
the record
number
in
the
ii\B,
nmexp2\$$BmMyf)\}
want
to write.
If
nmexp2
is
omitted, the current record
number
is
assumed.
This statement
moves
data
from
a
file's
buffer
into
a specified place
in
the
file.
Before PUTting
data
in
a
file,
you
must:
1
.
open
the
file,
thereby assigning
a buffer
and
defining the access
mode
(must
be
r);
137

Advertisement

loading