Function IndexOrd() Foundation
Returns the ordinal position of the controlling index in a work area.
IndexOrd() --> nOrder
The return value of IndexOrd() is a integer numeric value indicating the position of the controlling index in the work area. Active indexes within a work area are numbered in the order that the index files were opened. When there is no controlling index, or when no index file is open, the value 0 is returned.
The function IndexOrd() exists for compatibility reasons. The function OrdNumber() should be used instead of IndexOrd().
The index function IndexOrd() determines the ordinal position of the controlling index in the list of active indexes of a work area. When the function is used without the alias operator, it returns the position of the controlling index from the current work area.
// The example shows the return values of IndexOrd().
PROCEDURE Test
USE Customer NEW EXCLUSIVE
INDEX ON CUSTNO TO CustA
INDEX ON Upper(LASTNAME+FIRSTNAME) TO CustB
SET INDEX TO CustA, CustB
? IndexOrd() // result: 1
? IndexKey(1) // result: CUSTNO
DbSetOrder(2)
? IndexOrd() // result: 2
? IndexKey(2) // result: Upper(LASTNAME+FIRSTNAME)
RETURN
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.