EasyManua.ls Logo

Tandy TRS-80 - Page 33

Tandy TRS-80
104 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
ONE
THING AT
A TIME
(Sequential
Access to a File)
A tape is
simple. There's only one way to put data
on
it and one way
to read it off. A disk is
more com-
plex. There are several ways to
"file" your
data
on
it.
In this
chapter
and the next, we'll show how to
write a
program
which stores data in a "sequential
access" disk
file. It's
the simplest file to create and
is actually very
similar
to a
tape
"file" In Chapter
7,
we'll introduce
"direct access,"
an alternate type
of disk file.
In showing how to store things on disk, we'll fre-
quently use the words disk
file
and
disk
directory.
We discussed these concepts
in
Chapter
2,
but we'll
summarize them
now.
Everything you store on
disk must
go
in
a
disk
file
and be assigned a
filename.
Your Computer will
index the location of the disk file
in the disk's
directory. For example, if you
want
to
store
the
names of your friends, you could put
them
in
a
disk
file
named "FRIENDS''
Your disk's directory
would then
index where,
on
the disk, "FRIENDS"
is stored.
There is, of course, a good reason for all
of this.
Using the disk filing system, the
Computer
will
be
able to immediately find any file
on the disk.
WRITING A DISK
FILE
Let's assume
you
want
to
"write" your checks on
the disk:
CHECKS
DR. HORN
SAFEWAY
FIRST CHRISTIAN
OFFICE SUPPLY
Weil start with a short, simple program which
writes the first check, "DR. HORN|' on the disk.
Insert
a
formatted disk in your disk drive.
(If
you
have more than one disk drive, use
drive
0.)
25