xHarbour Reference Documentation > Function Reference |
Moves the record pointer to a logical record number.
OrdKeyGoTo( <nIndexKeyNo> ) --> lSuccess
The function returns .T. (true) if the record pointer is successfully positioned on the specified logical record number, otherwise .F. (false) is returned.
The function OrdKeyGoTo() moves the record pointer based on its logical record number, which can be retrieved using function OrdKeyNo().
The logical record number represents the position of a record in the controlling index, while the physical record number Recno() represents a record's position in the database. Physical record movement is accomplished using function DbGoTo().
See also: | DbOrderInfo(), DbGoto(), LastRec(), OrdFindRec(), OrdKeyNo(), OrdKeyRelPos(), OrdKeyCount(), RecNo() |
Category: | Database functions , Index functions |
Source: | rdd\dbcmd.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example outlines the difference between physical and logical // record pointer movement. REQUEST Dbfcdx PROCEDURE Main USE Customer VIA "DBFCDX" INDEX ON Upper(LastName) TAG NAME TO Cust01 DbGoto( 1 ) // Physical first record ? Lastname, Recno(), OrdKeyNo() // result: Miller 1 15 DbGoto( LastRec() ) // Physical last record ? Lastname, Recno(), OrdKeyNo() // result: Smith 22 19 OrdKeyGoto( 1 ) // Logical first record ? Lastname, Recno(), OrdKeyNo() // result: Alberts 20 1 OrdKeyGoto( OrdKeyCount() ) // Logical last record ? Lastname, Recno(), OrdKeyNo() // result: Waters 15 22 USE RETURN
http://www.xHarbour.com