2 Comments
User's avatar
Vince's avatar

The TRS-80 Model I Disk BASIC was much cruder. All records were 256 bytes longer (1 sector). If you wanted to use 40-byte “logical records”, you’ve have to use some tricky math to find which physical record (sector) your logical record fell in, and then “how far into” that sector it actually appeared. So in our example of 40-byte records, record #10 would be in sector 2, starting at character position 144 (assuming we had logic to “split” record #7 *across* sectors 1 & 2). The code to place those 40 bytes of record #10 in R$ might be

100 OPEN “R”, FILE”, 1

1000 GET 1, 7

1010 FIELD 1, 143 AS SP$, 40 AS R$

Expand full comment
Gary Luckenbaugh's avatar

That is how BASIC-PLUS did it as well, except it was 512 bytes corresponding to the size of the sectors on the PDP-11's disk. I decided to use GW-BASIC as the example because it was much saner.

Expand full comment