Introduction; Sequential Files And Random Access Files - Epson TF-20 Reference Manual

Hx-20 disk basic
Hide thumbs Also See for TF-20:
Table of Contents

Advertisement

Commands and Statements
CLOSE................................... 4-6
DSKO$................................... 4-7
FIELD..................................... 4-9
FILES..................................... 4-10
FILNUM.................................4-11
FRMAT..................................4-12
GET........................................ 4-13
INPUT#................................. 4-14
KILL....................................... 4-15
LINE INPUT#........................4-15
LIST....................................... 4-16
LOAD..................................... 4-16
LOADM................................. 4-17
MERGE.................................. 4-18
LSET, RSET........................... 4-19
NAME....................................4-20
OPEN..................................... 4-21
PRINT# ................................. 4-22
PRINT# USING..................... 4-23
PUT........................................4-24
RESET...................................4-25
RUN....................................... 4-26
SAVE..................................... 4-27
SAVEM.................................. 4-28
WHILE...WEND..................... 4-29
SYSGEN................................ 4-30
Directions
CVI,CVS,CVD..........
.4-31
DSKF ........................
.4-32
DSKI$.......................
.4-32
EOF...........................
.4-33
INPUT$.....................
.4-33
LOC...........................
.4-34
LOF...........................
.4-34
MKI$, MKS$, MKD$.
.4-35
IV

1. INTRODUCTION

1.1 Sequential Files and Random Access Files

There are essentially two ways in which data can be accessed (stored and
retrieved). These are sequential and random access files.
As the name suggests, sequential files are files in which the data are
stored in sequence. Therefore, to retrieve data from the file, the data must
be read in sequence and unwanted data must be passed over until the
desired data is reached. Among the advantages of sequential files is the
fact that, since the data are stored in sequence, the only restriction on the
length of a file is the amount of memory available on the storage medium.
The simple configuration of sequential files also makes them quite easy to
understand and to handle. The main drawback of sequential files is that
because unwanted data must be. passed, they are quite slow compared
with random access files. The cassette tapes used in the external cassette
and the microcassette drive of the HX-20 are both sequential storages.
In a random access file, it is possible to go directly to the location in the
storage medium which you wish to read or write. This saves a great deal of
time and makes random access files faster to access than sequential files.
However, for random access files, in order to be able to locate data easily,
it is necessary that all records (the basic unit for handling data in files) be
the same length.
In Disk BASIC (the name of the version of BASIC used to operate the
TF-20), the fixed length of records is 128 bytes. To fix the length of the
variables used in a random access file, the FIELD statement is necessary.
LSET and RSET statements are used to store data in the random buffer.
The advantage of random access files is that they are very fast and the
disadvantages are that they use memory less efficiently than sequential
files and must be configured with some care. The TF-20 can be used for
both sequential and random access storage.
1-1

Advertisement

Table of Contents
loading

Table of Contents