DBF RECALL()

From Lianjapedia
Jump to: navigation, search

PURPOSE

Recall a deleted record

SYNONYM

api_dbf_recall()

SYNOPSIS

#include "lianja_api.h"
 
int	DBF_RECALL()
 
<input parameters>
none
 
<output parameters>
none

DESCRIPTION

The DBF_RECALL() function will return 1 if the current record can be recalled, and 0 if not. A -1 will be returned if no table is open in the current cursor.

On shared tables the record should be locked first before it is recalled. If you attempt to recall a record that is locked by another user, an error message will be displayed.

EXAMPLE

The following example locks, recalls and then unlocks the current record.

#include "lianja_api.h"
 
lianjaapi_dbf_recall()
{
    int	rc;
    long	recnum;
 
    if (DBF_ISEXCLUSIVE()) {
       rc = DBF_RECALL();
    } else {
       recnum = DBF_RECNO();
       DBF_LOCKR( recnum );
       rc = DBF_RECALL();
       DBF_UNLOCKR(recnum);
    }
 
    _retl( rc );
}

SEE ALSO

DBF_DELETE(), DBF_DELETED(), DBF_FETCH(), DBF_FILTER(), DBF_GOTO(), DBF_ISEXCLUSIVE(), DBF_ISREADONLY(), DBF_LOCKF(), DBF_LOCKR(), DBF_RECNO(), DBF_SKIP(), DBF_UNLOCKF(), DBF_UNLOCKR()