_DBRewind( ) (Rutina de biblioteca API)
Trabaja como el comando GO TOP de Visual FoxPro en el área especificada y devuelve después el número del registro actual.
long _DBRewind(int workarea)
int workarea; /* Work area. */
Ejemplo
El siguiente ejemplo llama a _DBRewind( ) para la tabla abierta en el área de trabajo actual. Esta rutina tiene el mismo efecto que el comando GO TOP de Visual FoxPro.
Código Visual FoxPro
SET LIBRARY TO DBREWIND
DO CreateTest
GO BOTTOM
? RECNO()
? DBREWIND() && returns 1
? RECNO() && yes, we're at record 1
PROCEDURE CreateTest
CREATE TABLE test (ABC C(20))
APPEND BLANK
REPLACE ABC WITH "This is record 1"
APPEND BLANK
REPLACE ABC WITH "This is record 2"
APPEND BLANK
REPLACE ABC WITH "This is record 3"
APPEND BLANK
REPLACE ABC WITH "This is record 4"
GO TOP
RETURN
Código C
#include <pro_ext.h>
FAR Example(ParamBlk FAR *parm)
{
_RetInt(_DBRewind(-1), 10);
}
FoxInfo myFoxInfo[] = {
{"DBREWIND", (FPFI) Example, 0, ""},
};
FoxTable _FoxTable = {
(FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
};
Vea también
_DBSkip( ) (Rutina de biblioteca API) | _DBUnwind( ) (Rutina de biblioteca API) | GO | GOTO (Comando) | Acceso a la API de Visual FoxPro