xHarbour Reference Documentation > Function Reference |
Returns the ordinal position of an open index by its symbolic name.
OrdNumber( [<cIndexName>][, <cIndexFile>] ) --> nOrder
The function returns a numeric value specifying the ordinal position of the index <cIndexName>. Indexes are numbered in the sequence of opening, beginning with 1. If no parameter is passed, the ordinal position of the controlling index is returned. If no index is open, or if the name <cIndexName> does not exist, the return value is zero.
OrdNumber() returns the ordinal position of an index based on its symbolic name. The name is specified with the TAG option of the INDEX command when the index is created. The reverse function of OrdNumber() is OrdName() which returns the symbolic name of an open index by its ordinal position.
See also: | Alias(), INDEX, OrdFor(), OrdKey(), OrdName() |
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 indexes. REQUEST Dbfcdx PROCEDURE Main USE Customer VIA "DBFCDX" ? OrdNumber() // result: 0 INDEX ON Upper(LastName+FirstName) TAG NAME TO Cust01 INDEX ON CustID TAG ID TO Cust01 ? OrdNumber() // result: 2 ? OrdKey() // result: CustID ? OrdNumber( "NAME" ) // result: 1 ? OrdKey( "NAME" ) // result: Upper(LastName+FirstName) USE RETURN
http://www.xHarbour.com