User`s manual

80 INPUT# 5, A$, X
90 IF A$ < > "Record Contents #" OR X < > R THEN STOP
110 PRINT# 15, "B-F:" 0, T, S "'"
120 NEXT R
Checks To Make
Sure Data Is OK
130 CLOSE4: CLOSE 5
140 PRINT# IS, "S0:KEYS"
150 CLOSE 15
BUFFER-POINTER
The buffer pointer keeps track of where the last piece of data waswritten.
It also is the pointer for where the next piece of data is to be read. By changing
the buffer pointer's location within the buffer, you can get random accessto the
individual bytes within a block. This way, you can subdivide each block into
records.
For example, let's take a hypothetical mailinglist. The information such as
name, address, etc., will take up a total of 64 characters maximum. We could
divide each block of the random access file into 4 separate records, and by
knowing the track, sector, and record numbers, we can access that individual
record.
FORMAT FOR BUFFER-POINTER COMMAND:
PRINT# file#, "BUFFER-POINTER:" channel, location
or abbreviated as
PRINT# file#, "B-P:" channel, location
EXAMPLE OF SETTING POINTER TO 64TH CHARACTER OF BUFFER:
PRINT# 15, "B-P:" 5, 64
Here are versions of the random access wwiting and reading programs
shown above, modified to work with records within blocks:
SAMPLE PROGRAM WRITING 10 RANDOM-ACCESSBLOCKS WITH 4
RECORDSEACH:
10OPEN
15,8,15
20 OPEN 5, 8, 5, "#
30 OPEN 4, 8,4, "KEYS,S,W"
40 A$= "Record Contents #"
50 FOR R=1TO 10
60 FORL=1 TO 4
31