Enscribe Programmer's Guide

find (mode, specifier, key value, comparison length, direction)
returns the position of first record in the file according to mode, specifier, key value, comparison
length, and direction.
If mode = 0 (approximate) positioning is to the first record whose key field, as designated
by the key specifier, is greater than or equal to the key value. If no such record
exists, an end-of-file indication is returned.
If mode = 1 (generic), positioning is to the first record whose key field, as designated by
the key specifier, contains a value equal to key for comparison length bytes.
If no such record exists, an end-of-file indication is returned.
If mode = 2 (exact), positioning is to the first record whose key field, as designated by
the key specifier, contains a value of exactly comparison length bytes and is
equal to key. If no such record exists, an end-of-file indication is returned.
find^next (mode, specifier, key value, comparison length, direction)
returns the position of the next record in the file according to mode, specifier, key value,
comparison length, and direction.
If mode = 0 (approximate), positioning is to the next record.
If mode = 1 (generic), positioning is to the next record. If the key field designated by the
key specifier does not equal key for comparison length bytes, an end-of-file
indication is returned.
If mode = 2 (exact), an end-of-file indication is returned.
insert (key value, key length)
returns the position where a record is to be added, according to the specified key value and
key length. If a record already exists at the indicated position, a duplicate record” indication
is returned. For relative and entry-sequenced files, a key value of “-1” returns the end-of-file
position and a key value of “-2” returns the position of the first available record.
Pseudocode Descriptions
These sets of pseudocode describe the behavior of the OPEN, KEYPOSITION, POSITION, READ,
READUPDATE, WRITEUPDATE, and WRITE procedures.
OPEN (FILE_OPEN_)
CKS := primary
if keyseq then CKL := CMPL := 0
else
begin
if format I file format CKL := 4
else CKL := 8;
CKV := rip := 0;
end;
MODE := approx;
next := false;
REVERSE := false;
FILE_SETKEY_, KEYPOSITION:
CKV := rip := key
if position-to-last then pad out CKV with %hFF
CKS := if present then key specifier else primary;
CKL := CMPL := if present then comparison length
else keylength (0, CKS);
MODE := if present then positioning mode else approx;
Pseudocode Descriptions 181