xHarbour Reference Documentation > Command Reference |
Moves the record pointer to a specified position.
GO[TO] <nRecno> | BOTTOM | TOP
The GO[TO] command positions the record pointer in the current work area to the specified position. The TOP and BOTTOM positions refer to the first and last logical records, while a numeric record number identifies a physical record.
If <nRecno> is smaller than 1 or larger than Lastrec(), the record pointer is positioned on the ghost record located at position Lastrec()+1.
Note: Logical conditions restricting visibility of records, like SET DELETED, SET FILTER or SET SCOPE, are only taken into account with the TOP and BOTTOM options of the GO command. Positioning the record pointer to a physical record number ignores such conditions.
See also: | Bof(), DbGoto(), Eof(), LastRec(), RecNo(), SET DELETED, SET FILTER, SET RELATION, SET SCOPE, SKIP |
Category: | Database commands |
Source: | rdd\dbcmd.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example demonstrates logical and physical positioning of the // record pointer. PROCEDURE Main USE Customer DELETE ? Recno(), Deleted() // result: 1 .T. SET DELETED ON GO TOP // Logical positioning ? Recno(), Deleted() // result: 2 .F. GOTO 1 // Physical positioning ? Recno(), Deleted() // result: 1 .T. USE RETURN
http://www.xHarbour.com