xHarbour Reference Documentation > Function Reference |
Determines the navigational order of a work area.
OrdDescend( [<cIndexName> | <nOrder>], ; [<cIndexFile>] , ; [<lNewDescendFlag>] ) --> lOldDescendFlag
The function returns the descend flag set before the function is called.
The function OrdDescend() is used to change the descend flag dynamically at runtime. The navigational order in a work area can be changed from ascending to descending and back without having to create a corresponding index. When .T. (true) is passed to the function, the navigational order is reversed, i.e. all functions and commands which move the record pointer are reversed.
Descending navigation
Function | Description |
---|---|
Bof() | Returns .T. when the last record is reached. |
Eof() | Returns .T. when the first record is reached. |
DbSkip( 1 ) | Moves the record pointer to the previous record. |
DbSkip(-1 ) | Moves the record pointer to the next record. |
DbGoTop() | Moves the record pointer to the last record. |
DbGoBottom() | Moves the record pointer to the first record. |
Note: the function changes the descending flag at runtime only. It does not change the actual index file.
See also: | DbOrderInfo(), INDEX, OrdCondSet(), OrdCustom() |
Category: | Database functions , Index functions |
Source: | rdd\dbcmd.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example creates an ascending index and demonstrates // the effect when the navigational order is reversed. PROCEDURE Main USE Customer INDEX ON Upper(Lastname+Firstname) TO Cust01 GO TOP ? LastName // result: Alberts GO BOTTOM ? LastName // result: Waters OrdDescend( ,, .T. ) // change navigational order SKIP -1 // skipping backwards from the last // record hits begin of file. ? Bof() // result: .T. GO BOTTOM ? Eof() // result: .F. ? LastName // result: Alberts SKIP ? Eof() // Result: .T. GO TOP ? LastName // result: Waters USE RETURN
http://www.xHarbour.com