MEMO RECLAIM()

From Recital Documentation Wiki
Jump to: navigation, search

PURPOSE

Reclaim space in a memo file


SYNONYM

api_memo_reclaim()


SYNOPSIS

#include "dbapi.h"
 
int	MEMO_RECLAIM(fldname)
 
<input parameters>
char	*fldname;	/* Address of a buffer containing the name of a memo field	*/
 
<output parameters>
none


DESCRIPTION

The MEMO_RECLAIM() function will free up space occupied by the memo field specified in the current record in the database. The space occupied by the memo will be reused for the next update of the memo file. All data in the specified memo field will be deleted. A value of -1 is returned if the field is not a MEMO, otherwise a value >0 will be returned for success.


EXAMPLE

The following deletes the contents of the memo field specified in the first parameter passed for the current record.

#include "dbapi.h"
 
dbapi_memo_reclaim()
{
    int	rc;
    if (_parinfo(1) == API_CTYPE ) {
 
       if (!DBF_ISEXCLUSIVE()) DBF_LOCKR(DBF_RECNO())
 
       rc = MEMO_RECLAIM(_parc(1));
       if (rc) rc = DBF_UPDATE();
 
       if (!DBF_ISEXCLUSIVE()) DBF_UNLOCKR(DBF_RECNO());
 
    } else {
       rc = -1;
    }
 
    _retni( rc );
}


SEE ALSO

DBF_DELETE(), DBF_RECALL(), MEMO_MLCOUNT(), MEMO_MLINE(), MEMO_READ(), MEMO_SIZE(), MEMO_UPDATE(), MEMO_WRITE()