| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Returns the symbolic name of an open index by its ordinal position.
OrdName( [<nOrder>] [,<cIndexFile>] ) --> cIndexName
The function returns the index name at position <nOrder> in the list of open indexes as a character string. If no parameters are passed, the index name of the controlling index is returned. If no index is open, the return value is an empty string ("").
OrdName() returns the symbolic name of an index as a character string. The name is specified with the TAG option of the INDEX command when the index is created. The reverse function of OrdName() is OrdNumber() which returns the ordinal position of an open index by its symbolic name.
| See also: | Alias(), INDEX, OrdFor(), OrdKey(), OrdNumber() |
| Category: | Database functions , Index functions |
| Source: | rdd\dbcmd.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example creates two indexes in one index file and displays.
// various information about the open indexes.
REQUEST Dbfcdx
PROCEDURE Main
USE Customer VIA "DBFCDX"
INDEX ON Upper(LastName+FirstName) TAG NAME TO Cust01
INDEX ON CustID TAG ID TO Cust01
? OrdName() // result: ID
? OrdKey() // result: CustID
? OrdSetfocus( "NAME" ) // result: ID
? OrdName() // result: NAME
? OrdKey() // result: Upper(LastName+FirstName)
? OrdName(1) // result: NAME
? OrdName(2) // result: ID
USE
RETURN
http://www.xHarbour.com