xHarbour Reference Documentation > Function Reference |
Returns the key expression of an index.
OrdKey( [<nOrder>|<cIndexName>][,<cIndexFile>] ) --> cIndexKey
The function returns the key expression of the specified index as a character string. If no parameters are passed, the index key of the controlling index is returned. If no index is open, the return value is an empty string ("").
OrdKey() returns the index key expression of an index as a character string. It is similar to OrdFor() which returns the FOR expression of the index.
See also: | DbOrderInfo(), INDEX, IndexKey(), OrdCreate(), OrdFor(), OrdKeyCount(), OrdKeyNo(), OrdKeyVal(), OrdName(), OrdNumber() |
Category: | Database functions , Index functions |
Source: | rdd\dbcmd.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example creates two indexes and displays their key expressions PROCEDURE Main USE Customer OrdCreate( "Customer1", "ID" , "CUSTNO" ) OrdCreate( "Customer2", "NAME", "Upper(LastName+FirstName)" ) OrdSetFocus( "ID" ) ? OrdKey() // result: CUSTNO OrdSetfocus( "NAME" ) ? OrdName() // result: NAME ? OrdNumber() // result: 2 ? OrdKey() // result: Upper(LastName+FirstName) ? OrdKey(1) // result: CUSTNO ? OrdKey( "NAME" ) // result: Upper(LastName+FirstName) USE RETURN
http://www.xHarbour.com