Specifications

Program 5
10 c$ = : CR$ = chr$(13) ! CR$ will separate the three fields
20 open #2, "(f:100)check,rel", inout
30 for i : 1 to 5 ! create five records
40 print#2,i;c$;i*i;CR$;value$(i);c$;"record #";i;CR$;"this is it";CR$
50 next i ! last CR$ is optional
60 linput #2, rec=3, a$ ! input first field, record #3
70 linput #2, b$ ! input second field, same record
80 linput #2, c$ ! input third field
90 print a$ : print b$ : print c$ ! print the three fields
100 stop
[Ed. You'll find what Loch writes most useful, but only if you enter the pro
grams, run 'em, and revise 'em. As Gary Ratliff said, early on, "You learn to
program by programming, not by reading about it." We'll print a method by Loch,
next issue, which very cleverly lets you specify any date after 1900 and learn
where the record for that date is kept in a relative file.]
< X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X K X X > < X X X X X X X X X >
HOW MANY RELATIVE FILES We got a note from Stanley Brockman, 11715 W. 33rd
DID YOU SAY, STAN? Place, Wheat Ridge, Colorado, 80033, saying he was
happy he innocently didn't know he was supposed to
be limited to 720 records in relative files on his 4040 drive, else his primit
ive data base manager program wouldn't have more than 1000 records in it. Stan
went through his disk manual, and calculated he should be able to get 2088 rec
ords (as opposed to the 720 on p. 80 of the Gazette). He tested and confirmed
that number. Later, he wrote that on the CBM side
int(658*254/recordlength)-1 you can get one more relative record: 2089, though
= 2088 records he isn't sure why. We double-checked Stan's figures
and stuffed REL records on the drives listed below,
until they would not take more. The capacities on 80-byte records in SPET most
certainly are what Stan says they are. We read good files through the numbers
listed below:
Micropolis 8050 Tandon 8050 Tandon 4040
Records 2285 2285 2088
Blocks 726 726 664
* « «
ON EDITING REL FILES You can pull 1068 80-byte records into the microEDITOR
from a REL file before memory fills; if you have this
number of records or less, it's a nice way to get a list which correlates record
number with the data in that record. You can also get records larger than 80
bytes into mED for the same reason, but you must specify the record size if you
try, as in the 'get' at left. You can recover a REL file in
g (f:200)file,rel 'fixed' filetype as a TEXT file, but the format is mucked up.
(t: works) If you refile an edited REL file from the mED as a RELATIVE
file, despite the record size you may specify (as in f:200), you'll never get it
back in 200-byte chunks but rather in lines of 80 bytes. In language, if you
ask for input of rec = 20, you'll get back the contents of the twentieth line in
the file (assuming option base 1).
There is one exception: you can edit and refile records of 80 bytes, because in
such files one line = 80 bytes. Otherwise, don't refile REL files from the mED;
you ruin the relative access to the file. (If you do refile it,
p file,rel specify it as a relative file, as at left.)
SuperpPET Gazette, Vol.I No.11 -172- December 1983/January 1984