CTTable.MoveSegment
Moves a key segment.
Declaration
void CTTable.MoveSegment(CTIndex hIndex, NINT segNumber, NINT newIndex);
void CTTable.MoveSegment(NINT indexNumber, NINT segNumber, NINT newIndex);
void CTTAble.MoveSegment(const CTString& indexName, NINT segNumber, NINT newIndex);
Description
CTTable.MoveSegment() moves a key segment to a location indicated by newIndex. hIndex is a index object, indexNumber is a relative number for a index object in a table definition and indexName is the unique name for the index. newIndex indicate the relative position were the key segment should be moved to.
Return
void
Example
// move the last segment to first
CTIndex hIndex = hTable.GetIndex(0);
NINT count = hIndex.GetSegmentCount();
if (count > 0)
hTable.MoveSegment(hIndex, (count - 1), 0);
See Also
CTIndex.MoveSegment(), CTSegment.MoveSegment()