DBF DELETE()

From Lianjapedia
Jump to: navigation, search

PURPOSE

Delete the current record

SYNONYM

api_dbf_delete()

SYNOPSIS

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

DESCRIPTION

The DBF_DELETE() function will delete the current record in the active table. On shared tables the record should be locked first before it is deleted. If you attempt to delete a record that is locked by another user, then an error message will be displayed.

Deleted records remain in the database until a PACK is performed on the table. The command SET DELETED defines if the record will be displayed

EXAMPLE

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

#include "lianja_api.h"
 
lianjaapi_dbf_delete()
{
    int	rc;
    int	recnum;
 
    if ( DBF_ISEXCLUSIVE() ) {
       _rc = DBF_DELETE();
    } else {
       recnum = DBF_RECNO();
       DBF_LOCKR( recnum );
       rc = DBF_DELETE();
       DBF_UNLOCKR( recnum );
    }
 
    _retl( rc );
}

SEE ALSO

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