Function OrdKey() Foundation
Returns the index expression of an index.
OrdKey( [<cTagName>|<nIndex>] ) --> cIndexKey
The return value of OrdKey() is a character string containing the index expression (index key) used to create the index. If no index file is open, the function returns a null string (""). If no value is specified for <nIndex> or <cTagName>, the index expression of the controlling index is returned.
The index function OrdKey() determines the index key expression of an open index in a work area. When the function is used without the alias operator, it returns an index expression from the current work area. The index can be specified by a numeric value or by its name.
The ability to manage several indexes within an index file depends on whether the active database engine (DBE) can support multiple indexes. If the current DBE does not support multiple indices, a recoverable runtime error occurs.
Knowing the index expression of the controlling index is important for data input routines. When data input changes the logical record order of a DBF file, the screen must be refreshed following the input. This is generally required when data is displayed in BROWSE mode. The function OrdKey() allows the index expression and its current value to be recorded before and after data input. If the index value after input differs from the index value before input, the screen display must be refreshed.
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.