DBF GOTO()

From Recital Documentation Wiki
Revision as of 10:36, 30 March 2009 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

PURPOSE

Go to a record number


SYNONYM

api_dbf_goto()


SYNOPSIS

#include "dbapi.h"
 
int	DBF_GOTO(recnum)
 
<input parameters>
int	recnum;		/* Record number		*/
 
<output parameters>
none


DESCRIPTION

The DBF_GOTO() function is used to position the record pointer to the specified record in the active database and then read the record into currently selected workarea. If the active database is indexed, then once the record pointer is positioned, and the record read into currently selected workarea, the indexes are repositioned automatically. If SET RELATION TO is in effect for the active database, then any associated databases are related after the record pointer has been positioned. It is worth noting that the GOTO always goes to the relative record in the database, and not the relative record according to the index order. You can position to records which are marked for deletion, even if SET DELETED ON is in effect.

The following variables may be used instead of a record number.

VARIABLE DESCRIPTION
API_BOTTOM Goto the last record in the database
API_TOP Goto the first record in the database


EXAMPLE

The following example goes to the last record in the database.

#include "dbapi.h"
 
dbapi_dbf_goto()
{
    int	rc;
 
    rc = DBF_GOTO (DBF_RECCOUNT());
 
    _retl( rc );
}


SEE ALSO

DBF_FETCH(), DBF_ISBOF(), DBF_ISEOF(), DBF_LOCKR(), DBF_RECCOUNT(), DBF_RECNO(), DBF_SEEK(), DBF_SELECT(), DBF_SKIP(), DBF_UNLOCKR()