FirstInVSet
Read the first variable-length data record in the set defined by target.
Short Name
FRSVSET()
Type
ISAM function
Declaration
COUNT FirstInVSet(FILNO keyno, pVOID target, pVOID recptr,
COUNT siglen, pVRLEN plen)
Description
In V12 the file number typedef was formally changed from COUNT, a two-byte value to FILNO, a four-byte value. Refer to this link for compatibility details. Four Byte File Numbering
FirstInVSet() is identical to it’s fixed-length counterpart, FirstInSet(), except that it reads the first variable-length data record in the set of data records whose keys match the target key in the first siglen bytes. If successful, this record becomes the current ISAM record for the associated data file.
plen acts as both an input and output parameter:
Read the function description for FirstInSet() for additional important information.
Return
Value |
Symbolic Constant |
Explanation |
---|---|---|
0 |
NO_ERROR |
Successful retrieval of current ISAM record. |
633 |
NPLN_ERR |
plen is NULL. |
634 |
NLEN_ERR |
plen is negative on input. |
See FairCom DB Error Codes for a complete listing of valid FairCom DB error values.
Example
FILNO keyfil;
COUNT siglen;
TEXT target[24],recbuf[320];
printf("\nEnter set value:");
scanf("%23s",target);
printf("\nEnter the significant length:");
getnumber(&siglen);
FirstInVSet(keyfil,target,recbuf,siglen,strlen(target));
while (isam_err == NO_ERROR) {
process_data();
NextInVSet(keyfil,recbuf);
}
See also
FirstInSet(), NextInVSet(), PreviousInVSet(), LastInVSet(), PositionVSet(), ChangeSet(), TransformKey().