Using KSAM/XL and KSAM 64 (32650-90886)

248 AppendixB
BASIC/V Intrinsics
BKREAD
A5 a 5-word integer array
A2 a 2-word integer array
A3 a 3-word integer array
B1$ a 1-character string
B2$ a 2-character string
The five integers that were written to the beginning of each record are read into array A5.
The next two arrays A2 and A3 receive the undefined values that filled the next five words
of the record. The first string character is read into B1$, the next two into B2$.
If you open the file for read-only access (
access
=0), and the
exclusive
parameter is
allowed to default to zero, then more than one user can share read access to the file. In this
case, or if you specifically indicate shared access, you should also allow dynamic locking in
order to read records from the file in key sequence. This is necessary because BKREAD
depends on the current position of the logical record pointer. (Refer to Table B-2. for a list
of the pointer-dependent procedures.)
For example, if you plan to read the file sequentially starting from a particular key value,
use the following sequence of calls:
BKOPEN <--------
open file for read-only, shared access, allow dynamic locking
BKLOCK <--------
lock file
BKSTART <--------
position pointer
BKREAD loop <--------
read file in sequence from original pointer position
BKUNLOCK <--------
unlock file when last record read