Function DbSetDescend() Foundation
Reverses the navigational order of a work area.
DbSetDescend( <lDescend> ) --> NIL
The return value of DbSetDescend() is always NIL.
The function DbSetDescend() is used to quickly change the navigational order in a work area from ascending to descending and vice versa without the need to create a corresponding index. When .T. (true) is passed to the function, the navigational order is reversed, i.e. all functions and commands that move the record pointer are inverted.
Function | Description |
---|---|
DbGoTop() | Positions the record pointer on the last record |
DbGoBottom() | Positions the record pointer on the first record |
DbSkip( 1 ) | Moves the record pointer to the previous record |
DbSkip(-1 ) | Moves the record pointer to the next record |
Bof() | Returns .T. when attempting to move the record pointer behind the last record |
Eof() | Returns .T. when attempting to move the record pointer before the first record |
// The example demonstrates the effect of
// reversing the navigational direction
PROCEDURE Main
USE Customer
? Recno(), LastRec() // Result: 1, 22
GO BOTTOM
? Recno() // Result: 22
DbSetDescend( .T. )
SKIP -1
? Recno(), Bof() // Result: 23, .T.
GO BOTTOM
? Recno(), Eof() // Result: 1, .F.
SKIP
? Recno(), Eof() // Result: 1, .T.
USE
RETURN
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.