Download Print this page

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

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

Advertisement

TRS-80
MODEL
III
DISK
SYSTEM
Sequential
Access
This
is
the
simplest
way
to store
data
in
and
retrieve
it
from
a
file. It is
ideal for
storing
free-form data without wasting space
between
data items.
You
read
the
items
back
in
the
same
order
in
which
they
were
written.
There
are several
important
points
to
keep
in
mind.
1
.
You
must
start
writing
at
the
beginning of
the
file.
If
the
data
you
are
seeking
is
somewhere
inside,
you have
to
read
your
way
up
to
it.
2.
Each
time
you
Open
a
file
for
sequential output, the
file's
previous contents
are
lost,
unless
you
use
"E"
instead
of
"O"
for the
mode.
3.
To
update (change)
a sequential
file,
read
in
the
file
and
write out the
updated
data
to
a
new
output
file.
4.
Data
written sequentially usually includes delimiters (markers)
to
signify
where
each
data
item begins
and
ends.
To
read
a
file
sequentially,
you must
know
ahead of
time
the
format of
the
data.
For example:
Does
the
file
consist
of
lines
of
text
terminated with
carriage returns?
Does
it
consist
of
numbers
separated
by
blank spaces?
Does
it
consist
of
alternating text
and numeric
information?
5.
Sequential
files
are
always
written
as
Ascn-coded
text,
one
byte
for
each
character
of
data.
For example,
the
number:
1*2345
requires 8 bytes
of
disk storage, including the leading
and
trailing
blanks
that
are supplied.
The
text
string:
JOHNSON
*
ROBERT
requires
15
bytes of disk
storage.
6.
Sequential
files
are
always
written
with
a
record length of 256.
Sequential
Output:
An
Example
Suppose
we
want
to store
a table
of English-to-metric conversion
constants:
English
unit
Metric equivalent
1
inch
2.54001 centimeters
1
mile
1.60935
kilometers
1
acre
4046.86
sq.
meters
1
cubic
inch
0.01638716
liter
1
U.S. gaifon
3.785
liters
1
liquid
quart
0.9463
liter
1
lb
(avoir)
0.45359
kilogram
146

Advertisement

loading