Product Documentation

c-treeDB API for C++ - Developers Guide

Previous Topic

Next Topic

CTIndex::MoveSegment

Moves a key segment.

Declaration

void CTIndex::MoveSegment(NINT segmentNumber, NINT newIndex);

Description

CTIndex::MoveSegment() moves a key segment to a location indicated by newIndex.

  • segmentNumber is a relative number for a segment in an index definition.
  • newIndex indicates the relative position were the key segment should be moved to.

Return

None.

Example


// move the last segment to first

CTIndex hIndex = hTable.GetIndex(0);

NINT count = hIndex.GetSegmentCount();


if (count > 0)

hIndex.MoveSegment((count - 1), 0);

See Also

CTTable::MoveSegment(), CTSegment::MoveSegment()

TOCIndex