MEMO READ()

From Recital Documentation Wiki
Jump to: navigation, search

PURPOSE

Read a memo field


SYNONYM

api_memo_read()


SYNOPSIS

#include "dbapi.h"
 
int	MEMO_READ(fldname, memobuf, maxsize)
 
<input parameters>
char	*fldname;		/* Address of a buffer containing the name of a field memo	*/
int	maxsize;		/* Maximum size of the memo						*/
 
<output parameters>
char	*memobuf;	/* Address of a buffer where the memo is stored			*/


DESCRIPTION

The MEMO_READ() function will update a buffer with the contents from the specified memo field on the current record. The number of bytes read from the memo is specified by maxsize, a Recital string can store up to 8000 bytes.

A value of -1 is returned if the field is not a MEMO, otherwise the number of bytes read is returned.


EXAMPLE

The following example returns the contents of the memo field specified in the first parameter passed.

#include "dbapi.h"
 
dbapi_memo_read()
{
    unsigned char	memobuf[8000];
    int		memosize;
    int		result;
 
    if (_parinfo(1) == API_CTYPE ) {
       memosize = MEMO_SIZE( _parc(1) );
       if (memosize >= 0) {
       result = MEMO_READ( _parc(1), memobuf, memosize);
       } else {
       _retc("Not a memo field.");
       }
    } else {
       strcpy(memobuf, "");
       memosize=0;
    }
 
       _retclen(memobuf, memosize);
 
}


SEE ALSO

BLOB_READ(), DBF_FETCH(), DBF_READ(), DBF_RECBUFFER(), DBF_SCATTER(), FIELD_VALUE(), MEMO_MLCOUNT(), MEMO_MLINE(), MEMO_RECLAIM(), MEMO_SIZE(), MEMO_UPDATE(), MEMO_WRITE()