User`s manual

Upon execution, the DOSfirst checksto see if the file exists.If it does,
then nothing happens. The only way to erase an old relative file is by using the
SCRATCHcommand (see chapter 4), but not by using the replace option.
Using Relative Files
In order to OPEN a relative file once it exists, the format is simpler.
FORMAT FOR OPENING AN EXISTING RELATIVE FILE:
OPEN file#, device#, channel#, "name"
In this case, the DOS automatically knows that it is a relative file. This
syntax, and the one shown in the above section, both allow either reading or
writing to the file.
In order to read or write, you must, before any operation, position the file
pointer to the correct record position.
FORMAT FOR POSITION COMMAND:
PRINT# file#, "P" CHRS(channel#) CHR$(rec# 10) CHR$(rec# hi)
or optionally as
PRlNT#file#, "P" CHR$(channel#) CHR$(rec#lo) CHR$(rec#hi) CHR$(position)
PRINT# IS, "P" CHR$(2
~
CHR$(I) CHR$(O)
~
PRINT# 15, "P" CHR$(CH) CHR$(Rl) CHR$(R2)
PRINT# 15, "P" CHR$(4) CHR$(R{fCHR$(R2) ~R$(P)
EXAMPLES OF POSITION COMMAND:
The 2.byte format for the record number is needed because one byte can
only hold 256 different numbers, and we can have over 700 records in the file.
The rec# 10contains the least significant part of the address, and the rec# hi is
the most significant part. This could be translated to the actual record number
by the"formula REC#= REC HI * 256 + REC LO.
Let's assume we have a mailing list. The list consists of 8 pieces of data,
according to this chart:
Field Name
Length
first name
last name
address line 1
address line 2
city
12
15
20
20
12
state 2
zip code 9
phone number 10
----------
TOTAL 100
35