Product Documentation

c-treeDB API for C++ - Developers Guide

Previous Topic

Next Topic

CTTable::MoveSegment

Moves a key segment to a location.

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 an index object.
  • indexNumber is a relative number for a index object in a table definition.
  • indexName is the unique name for the index.
  • newIndex indicates 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()

TOCIndex