DBF GOTO()

From Lianjapedia
Jump to: navigation, search

PURPOSE

Go to a record number

SYNONYM

api_dbf_goto()

SYNOPSIS

#include "lianja_api.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 table and then read the record into currently selected cursor. If the active table is indexed, then once the record pointer is positioned, and the record read into currently selected cursor, the indexes are repositioned automatically. If SET RELATION TO is in effect for the active table, then any associated tables are related after the record pointer has been positioned. It is worth noting that the GOTO always goes to the relative record in the table, 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 table.

#include "lianja_api.h"
 
lianjaapi_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()