xHarbour Reference Documentation > Function Reference |
Positions the record pointer on a particular record.
DbGoto( <xRecno> ) --> NIL
The return value is always NIL.
The DbGoto() function moves the record pointer to the record identified with <xRecno>. This position is independent of any index or filter currently active in the work area, i.e. <xRecno> does not change with the logical order of records but identifies records physically.
Issuing a DbGoto( Recno() ) call in a network enviroment will refresh the database and index buffers. This is the same as a DbSkip(0) call. The parameter <xRecno> may be something other than a record number, depending on the RDD used. In some data formats, for example, the value of <xRecno> is a unique primary key, while in other formats, <xRecno> could be an array offset if the data set was an array.
If the record <xRecno> does not exist in the work area, the record pointer is positioned on the "ghost record" (Lastrec()+1), and both, BoF() and Eof(), are set to .T. (true).
See also: | Bof(), DbGoBottom(), DbGoTop(), DbSeek(), DbSkip(), Eof(), GO, OrdKeyGoTo() |
Category: | Database functions |
Source: | rdd\dbcmd.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example physically moves the record pointer and outlines // some important state variables of a work area. PROCEDURE Main USE Customer ? Recno(), LastRec() // result: 1 225 DbGoto(10) ? Recno(), LastRec() // result: 10 225 DbGoto(1000) ? Recno(), Bof(), Eof() // result: 226 .T. .T. DbGoto(-1) ? Recno(), Bof(), Eof() // result: 226 .T. .T. USE RETURN
http://www.xHarbour.com