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

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

Advertisement

DISK BASIC
Random
Access:
A
general
procedure
The
above example shows
the necessary sequences
to read
and
write using
random
access.
But
it
does not demonstrate the primary
advantages of
this
form
of
access
in particular,
it
doesn't
show
how
to
update
existing
files
by
going
directly to
the desired record.
The
program
below,
GLOSSACC/BAS,
develops the
glossary
example
to
show some
of
the techniques of
random
access for
file
maintenance.
But
before looking
at
the
program, study
this
general
procedure
for
creating
and maintaining
files
via
random
access.
Step
Number
See
GLOSSACC/BAS,
Line
Number
1.
OPEN
the
file
110
2.
FIELD
the buffer
120
3.
GET
the record to
be updated
140
4.
Display current contents of
145-170
the record (use
CVD,CVI,CVS
before
displaying
numeric
data)
5.
LSET
and
RSET
new
values into
210-230
the
fields
(use
MKD$,MKI$,MKS$
with numeric data before
setting
it
into the buffer)
6.
PUT
the
updated
record
240
7.
To
update another
record,
continue
250-260
at
step
3.
Otherwise, go
to step
8.
8.
Close the
file
270
7-68

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents