_DBUnwind( ), API-Bibliotheksroutine

Funktioniert wie der Visual FoxPro-Befehl GO BOTTOM im angegebenen Arbeitsbereich und gibt anschließend die aktuelle Datensatznummer zurück.

long _DBUnwind(int workarea)
int workarea;               /* Work area. */

Beispiel

Im folgenden Beispiel wird _DBUnwind( ) für die im aktuellen Arbeitsbereich geöffnete Tabelle aufgerufen.

Visual FoxPro-Code

SET LIBRARY TO DBUNWIND
DO CreateTest
? DBUNWIND()   && returns new record #
SKIP
? EOF()       && now EOF() returns .T.

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-Code

#include <pro_ext.h>

FAR Example(ParamBlk FAR *parm)
{
   _RetInt(_DBUnwind(-1), 10);
}

FoxInfo myFoxInfo[] = {
   {"DBUNWIND", (FPFI) Example, 0, ""},
};

FoxTable _FoxTable = {
   (FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
};

Siehe auch

_DBRewind( ), API-Bibliotheksroutine | _DBWrite( ), API-Bibliotheksroutine | Bearbeitung von Feldern und Datensätzen | Datensätze