DBF SKIP()

From Lianjapedia
Jump to: navigation, search

PURPOSE

Skip records

SYNONYM

api_dbf_skip()

SYNOPSIS

#include "lianja_api.h"
 
int	DBF_SKIP(amount)
 
<input parameters>
int	amount;			/* Number of records	*/
 
<output parameters>	
none

DESCRIPTION

The DBF_SKIP() function moves the record pointer forwards or backwards in the currently selected table. The amount may be a positive or negative value.

If the currently selected table is indexed, then the DBF_SKIP() function follows the order of the master index. The SET ORDER TO command can be used to select which of the open index files should be master.

If the record pointer is currently positioned on the first record of the table, and DBF_SKIP(-1) is specified, then the DBF_ISBOF() function will return 1. If the record pointer is currently positioned on the last record of the table and DBF_SKIP(1) is specified, then the DBF_ISEOF() function will return 1.

The record pointer will also be moved on any related table.

EXAMPLE

The following example will skip the number of records specified in the first parameter passed.

#include "lianja_api.h"
 
lianjaapi_dbf_skip()
{
    int	rc;
 
    if (_parinfo(1) == API_NTYPE) {
       rc = DBF_SKIP(_parni(1));
    } else {
       rc = -1;
    }
 
    _retni( rc );
}

SEE ALSO

DBF_DELETED(), DBF_FETCH(), DBF_FILTER(), DBF_GOTO(), DBF_ISBOF(), DBF_ISEOF(), DBF_LOCKR(), DBF_RECNO(), DBF_SEEK(), DBF_UNLOCKR()