Download Print this page

Radio Shack TRS-80 Model II Reference Manual page 178

Disk operating system
Hide thumbs Also See for TRS-80 Model II:

Advertisement

-Model II
TRSDOS
Record Processing Capabilities
Model II TRSDOS allows both Direct and Sequential file access. Direct
access- sometimes called "random access", but "direct" is more descriptive
- allows you to process any record you specify.
Note: A file can contain up to 65535 records. Records are numbered from 0
(beginning of file) to 65534. A record number of 65535 indicates the end of file
(EOF). These limits will be changed in a later release ofTRSDOS.
Sequential access allows you to process records in sequence: Record N, N
+
1,
N
+
2, .... With sequential access, you do not specify a record number;
instead, the Operating System accesses the next record following the last
record processed.
For files with fixed length records (FLRs) you can position the current record
pointer to the beginning of the file, end of file, or to any record in the file. In
short, you can use Direct and/or Sequential Access with FLRs at any time
during processing.
For files with variable length records (VLRs) you can only position" to the
beginning of the file or to the end of file. You cannot position to any other
record in the file, since the position of interior VLRs cannot be calculated.
If
short, you can only use Sequential access with VLRs.
The Direct access routines are Direct-Read and Direct-Write; the Sequential
access routines are Read-Next and Write-Next. Direct access routines always
access the record you specify. Sequential access routines always access the
record following the last record processed. (When the file is first opened,
sequential processing starts with record 0.)
Examples
Assume you have a Fixed Length Record file currently Open. Here are some
typical sequences you can accomplish via the file processing routines.
1. Read and/or write records in the file - in any order
This is done using Direct-Write and Direct-Read routines. You could read
record 5, write at end of file, read record 3, write record 3, etc.
2. Sequential Read (or Write) beginning anywhere in the me.
First you would do a Direct-Read to the record where you want to start
reading or writing. After that, you would do sequential reads or writes until
done.
214

Advertisement

loading