Download Print this page

Radio Shack TRS-80 Model II Reference Manual page 50

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

Advertisement

Library Commands
CREATE NAMES/TXT. IRIS
NRECS=500, LRL=30
Creates a file named NAMES/TXT protected by the password IRIS. The file will
be large enough to contain 500 records, each 30 bytes long.
Determing the size of the file
You can allocate space according to number of granules or number of
records.
(A
granule contains 1280 bytes; a record contains from 1 to 256
bytes, depending on LRL.)
The granule is the unit of allocation in TRSDOS: if you ask for 30 granules,
that's exactly how much space the file will get (38,400 bytes).
If, on the other hand, you specify the number of records, TRSDOS will give
you the number of granules which are required to contain that many records.
For example, if you specify 100 records and a record length of 40, you're
asking for a total of 100* 40=4000 bytes. Since TRSDOS allocates spaces in
units of granules (1280 bytes), you'll actually get 4 granules-containing 5120
bytes.
Record Length (Fixed-Length Files Only)
A
record is the quantity of data TRSDOS processes for you during disk
operations. The record length can be any value from 1 to 256.
File Type
TRSDOS.allows two types of files: Fixed-Length Record (FLR) files and
Variable-Ltfngth Record (VLR) files. With FLR files, the record length (from 1
to 256) is set when the file is created, and it cannot be changed. With VLR files,
the length of each record is independent of all other records in the file. For
example, record 1 might have a length ono; record 2,33; record 3,225; etc.
Variable length records consist of a length byte followed by the data, and can
contain up to 256 bytes including the length byte.
For further explanation of file structure, allocation and types, see Technical
Information.
To Create a file to be used by BASIC
1.
Decide how many records the file will contain. (This is just an estimate.
If
the file exceeds this number, it will automatically be extended.)
2. If it is a Direct access file, determine the optimum record length (from 1 to
256).
If
it is a sequential access file, the record length must equal 1.
3. Use a CREATE command like this:
CREATE
file {NRECS=number, LRL=length}
83

Advertisement

loading