QMSelectLeft(), QMSelectRight() |
|
|
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
where
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. The function returns the data value associated with the index entry found. The select list identified by ListNo is set to contain the records ids of the records that have this data value.
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. Although other errors may occur, two useful status values are
The number of items in the select list can be established by using QMGetVar() to retrieve the @SELECTED variable immediately after the QMSelectIndex.
|