ChangeSet
Change current set.
Short Name
CHGSET()
Type
ISAM function
Declaration
COUNT ChangeSet(COUNT setnum)
Description
ChangeSet() is called before each use of a set function when multiple sets are in use at the same time. As a new set area is needed, call ChangeSet() with a unique setnum.
When ChangeSet() perceives a previously unused setnum value, AllocateSet() is called to allocate the necessary set structures for this new setnum. These structures are not a concern of your program, but they are required for multiple, simultaneous sets.
Changing between active sets is accomplished by passing the desired setnum value. setnum values do not need to be consecutive and can be positive or negative values up to the maximum value of COUNT. See your compiler’s limits.h file for the maximum value of a 2-byte integer.
Return
Value |
Symbolic Constant |
Explanation |
---|---|---|
0 |
NO_ERROR |
Successful set change. |
185 |
ISAL_ERR |
No memory available for set buffers. |
See FairCom DB Error Codes for a complete listing of valid FairCom DB error values.
Example
COUNT i;
FILNO keyno,keyno1;
struct DATAREC datrec0,datrec1;
if (ChangeSet(0))
printf("\nCould not change set. Error = %d\n", isam_err);
if (FirstInSet(keyno0,&datrec0))
printf("\nCould not get FirstInSet. Error = %d\n", isam_err);
if (ChangeSet(1))
printf("\nCould not change set. Error = %d\n", isam_err);
if (LastInSet(keyno1,&datrec1))
printf("\nCould not get LastInSet. Error = %d\n", isam_err);
See also
AllocateSet, FreeSet, FirstInSet, LastInSet, NextInSet, PreviousInSet