Product Documentation

c-treeDB API for C# - Developers Guide

Previous Topic

Next Topic

CTRecord.RangeOn

Syntax

void RangeOn(int SegCount, Byte[] lRange, Byte[] uRange, int[] operators)

Parameters

  • SegCount [IN] segcount indicates the number of index segments values that should be used for setting the range, and the number of operators, since there must be one operator for each key segment in lRange and/or uRange.
  • lRange [IN] lrange is a buffer with the lower range segment values. Use the function ctdbBuildTargetKey() to build the lRange buffer.
  • uRange [IN] urange is a buffer with the upper range segment values. Use the function ctdbBuildTargetKey() to build the uRange buffer.
  • operators [IN] operators is an array of operators. There must be one operator for each key segment in lRange and/or uRange.

The operators RANGE_OP.EQ, RANGE_OP.NE, RANGE_OP.GT, RANGE_OP.GE, RANGE_OP.LE, RANGE_OP.LT are open ended and use only the lrange buffer for range values and the equivalent key segment in urange is ignored and maybe set to null (ascii \0 values). The operators RANGE_OP.BET, RANGE_OP.BET_IE, RANGE_OP.BET_EI, RANGE_OP.BET_EE and RANGE_OP.NOTBET use both lrange and urange buffers to establish the lower and upper bound values.

Description

RangeOn() establish a new range based on the key segment values passed on lRange and uRange buffers, and the operators for each segment. Once the range is set, use First(), Next(), Prev() and Last() to navigate the records in the specified range.

The range is set for all index entries that are situated between the lower bounds and upper bounds values. The segment values are stored in lrange and urange buffers in the same order and type of the index segment definition. If a previous range exists for this index, the previous range is released and the new range is established. Ranges take precedence over sets. If a record handle has a set established, record from a range will fetched instead of records from a range. Once the range is terminated, the records from a set is established..

Return

None.

See Also

IsRangeOn(), RangeOff()

TOCIndex