Function IndexKey() Foundation
Returns the index expression of an index file.
IndexKey( <nIndex> ) --> cIndexKey
The return value of IndexKey() is a character string containing the index expression of the index file specified by <nIndex> in a work area. If no index file exists corresponding to <nIndex>, a null string ("") is returned. If the value zero is specified for <nIndex>, the index expression for the current controlling index is returned.
The function IndexKey() exists for compatibility reasons. The function OrdKey() should be used instead of IndexKey().
The index function IndexKey() determines the key expression of an index in a work area. When the function is used without the alias operator, it returns an index expression from the current work area.
Knowing the index expression of the controlling index is very important during data input routines. If data input changes the logical record order of a database file, the screen must be refreshed after the input. This is often required when data is displayed in the BROWSE mode either by the function DbEdit() or using a TBrowse object. The function IndexKey() allows the index expression and the current index value to be determined before and after the 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.