FairCom Corporation


F.15 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 Appendix A "c-tree Plus Error Codes" of the c-tree Plus Programmer's Reference Guide for a complete listing of valid c-tree Plus error values.

EXAMPLE

COUNT i,keyno0,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, and PreviousInSet.


FairCom Corporation
www.faircom.com