xHarbour Reference Documentation > Function Reference |
Returns the ordinal position of the controlling index in a work area.
IndexOrd() --> nOrder
The function returns the ordinal position of the controlling index as a numeric value. If no index or database is open in the work area, the return value is zero.
The function is used to retrieve the ordinal position of the controlling index in the list of open indexes. Indexes are numbered in the sequence of opening, beginning with 1.
IndexOrd() is mainly used to save the position of the controlling index, temporarily change the controlling index, and restore it using DbSetOrder() or OrdSetFocus() when a database operation is complete.
See also: | INDEX, DbSetOrder(), IndexKey(), OrdKey(), OrdListAdd(), OrdNumber(), OrdSetFocus(), SET INDEX, SET ORDER, USE |
Category: | Database functions , Index functions |
Source: | rdd\dbcmd.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example illustrates return values of IndexOrd(). REQUEST DBFCDX PROCEDURE Main RddSetDefault( "DBFCDX" ) USE Customer INDEX ON CustNO TAG ID TO Cust01 INDEX ON Upper(LastName+Firstname) TAG Name TO Cust01 ? IndexOrd() // result: 2 ? IndexKey(0) // result: Upper(LASTNAME+FIRSTNAME) DbSetOrder(1) ? IndexOrd() // result: 1 ? IndexKey(0) // result: CustID USE RETURN
http://www.xHarbour.com