EasyManua.ls Logo

Tandy TRS-80 - A more Direct Approach; (Direct Access to a File)

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...
DISK
FILE
STORAGE AftEA
Mo MxwTMice
u>mwor
HumeeR
A
MORE
DIRECT APPROACH
(Direct Access to a
File)
Up to
now, we
haven't been concerned with how
your data is
stored on
the disk. For example, you
might have
put
this in a disk file:
/
"MARIE
ALEXANDER*"
"J*
DO
E »
"
"MARK
JONES*" "BILL S
h/DAT
it
MITH
*S
'jtout
o£>
K
MME5/DAT
**
What if you
want to change "J. DOE," to
"ELLIOTT
HOBBS"? You could not ask the Com-
puter to go
directly
to "J.
DOE" The Computer
does not
know where it is.
All the files
we've
created so far have been
"sequential access!'
To find a particular item in a
sequential access file,
the Computer
must start at
the beginning and search
through each
item. It
can't go
directly
to
the item.
In short, a sequential
access file does not
take
full advantage of your
disk's
"filing
system."
USING
THE DISK FILING SYSTEM
In
Chapter
2
we
talked about how formatting your
disk creates
this filing system. In our analogy, the
file
cabinets are
the disk "tracks" and the file
drawers are the disk "sectors!' You can use
tracks
and sectors to immediately find any item you
want.
To
do
this, you
can divide your file into something
which
we call "records."
You can then write a pro-
gram
which
stores each record
in a sector and
allows you to put data
in the records. The next
page
shows how your
new
disk
file will look:
33

Related product manuals