MEMO WRITE()
PURPOSE
Write a string to a memo field
SYNONYM
api_memo_write()
SYNOPSIS
#include "dbapi.h" int MEMO_WRITE(fldname, memo) <input parameters> char *fldname; /* Address of a buffer containing the name of a memo field */ char *memo; /* Address of a buffer containing the memo */ <output parameters> none
DESCRIPTION
The MEMO_WRITE() function will update the specified memo field with the contents of the memo buffer. The space occupied by the memo in the memo in the memo file is not overwritten with the specified memo buffer. A value of -1 will be returned if the field is not a MEMO.
EXAMPLE
The following example updates the current contents of the specified memo with the value specified in the second parameter passed. It locks the record and then updates the record.
#include "dbapi.h" dbapi_memo_write() { int result; if (_parinfo(1) == API_CTYPE && _parinfo(2) == API_CTYPE) { if (!DBF_ISEXCLUSIVE()) DBF_LOCKR(DBF_RECNO()); result = MEMO_WRITE(_parc(1),_parc(2)); if (result) result = DBF_UPDATE(); if (!DBF_ISEXCLUSIVE()) DBF_UNLOCKR(DBF_RECNO()); } else { result = -1; } _retni(result); }
SEE ALSO
BLOB_UPDATE(), BLOB_WRITE(), DBF_APPEND(), DBF_DELETE(), DBF_ISEXCLUSIVE(), DBF_ISREADONLY(), DBF_LOCKF(), DBF_LOCKR(), DBF_RECALL(), DBF_UNLOCKF(), DBF_UNLOCKR(), FIELD_UPDATE(), MEMO_MLCOUNT(), MEMO_MLINE(), MEMO_READ(), MEMO_SIZE(), MEMO_UPDATE()