QMSelectLeft(), QMSelectRight()

Top  Previous  Next

 

The QMSelectLeft() and QMSelectRight() functions traverse an alternate key index, creating a select list from the entry to the left or right of the last entry processed.

 

 

Format

 

VBQMSelectLeft(ByVal FileNo as Integer, ByVal IndexName as String, ByVal ListNo as Integer) as String

 

Cchar * QMSelectLeft(int FileNo, char * IndexName, int ListNo)

 

ObjStr = Session->SelectLeft(FileNo, IndexName, ListNo)

 

where

 

Varis the variable to receive the index key value associated with the returned list.

 

FileNois the file number returned by a previous QMOpen() call.

 

IndexNameis the name of the alternate key index to be used.

 

ListNois the select list number (0 to 10).

 

 

The QMSelectLeft() and QMSelectRight() functions construct a select list from the alternate key index entry to the left or right  of the one most recently returned by QMSelectIndex(), QMSelectLeft() or QMSelectRight(). The position of the scan can be set at the extreme left using QMSetLeft() or at the extreme right using QMSetRight().

 

These operations allow a program to find a specific value and then walk through successive values in the sorted data structure that makes up an alternate key index.

 

If QMSelectIndex() is used to locate a value that does not exist in the index, QMSelectLeft() will return a list of records for the value immediately before the non-existant one and QMSelectRight() will return a list of records for the value immediately after the non-existant one.

 

The QMStatus() function returns zero if the operation is successful, non-zero if it fails because the index does not exist.