Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

SetAlternateSequence

Establishes an alternative collating sequence for an index file.

Short Name

SETALTSEQ()

Type

Low-Level index file resource function

Declaration

COUNT SetAlternateSequence(FILNO keyno, pCOUNT altseq)

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

SetAlternateSequence() assigns an alternative collating sequence to index keyno, which has just been created and not yet closed, or has been opened exclusively. Resources must be enabled for the index file in order to complete this function successfully.

altseq points to an array of 256 short integers representing the new collating sequence. The zero’th and 255th entries in the array must be zero and 255, respectively. All other entries must be between zero and 255, inclusively. The value in the array determines where the underlying byte value will be mapped: a high value implies toward the end of the sequence.

Although this is a low level function, it ordinarily only applies to ISAM level key operations in which segment mode 32 (ALTSEG) is used to specify the use of an alternative collating sequence. See alternate collating sequence in the index for additional information.

Return

Value

Symbolic Constant

Explanation

22

FNUM_ERR

keyno out of range.

47

FINT_ERR

c-tree has not been initialized.

48

FMOD_ERR

This function does not apply to data files.

62

LERR_ERR

File must be opened exclusively.

401

RNON_ERR

RESOURCES not enabled.

448

DEFP_ERR

File definition permission denied.

See c-tree Error Codes for a complete listing of valid c-tree error values.

Example

/* The start of a full alpha sort: A, a, B, b, etc. */


COUNT altseq[256];


altseq['A'] = 65;

altseq['a'] = 66;

altseq['B'] = 67;

altseq['b'] = 68;

/* Fill in ALL values in the array. */

See also

GetAlternateSequence()

TOCIndex