Product Documentation

c-treeDB API for C++ - Developers Guide

Previous Topic

Next Topic

CTTable::GetIdxno

Retrieve a table index file number given the index name or the c-treeDB index number.

Declaration

NINT CTTable::GetIdxno(const CTString& IndexName)

NINT CTTable::GetIdxno(NINT index)

Description

Retrieves the index file number given the index name or the c-treeDB index number.

  • IndexName contains the symbolic name for the index. Please note the difference between the index symbolic name and the index file name.
  • index is a c-treeDB index number. The first c-treeDB index number is zero.

Return

GetIdxno() returns a table index file number.

Example


// retrieve the first key of first index

TEXT keyval[256];


if (FirstKey(hTable.GetIdxno("IndexName"), keyval)

printf("FirstKey failed\n");


if (FirstKey(hTable.GetIdxno(0), keyval)

printf("FirstKey failed\n");

See Also

CTBase::SwitchInstance(), CTRecord::SwitchContext(), CTTable::GetDatno(), CTIndex::GetIdxno()

TOCIndex