MEMO MLINE()

From Recital Documentation Wiki
Jump to: navigation, search

PURPOSE

Extract a line of text from a memo


SYNONYM

api_memo_mline()


SYNOPSIS

#include "dbapi.h"
 
int	*MEMO_MLINE(fldname, line, lineno)
 
<input parameters>
char	*fldname;		/* Address of a buffer containing memo field name	*/
int	lineno;		/* Line number							*/
 
<output parameters>
char	*line;		/* Address of a buffer to return the memo line		*/


DESCRIPTION

The MEMO_MLINE() function extracts a line of text from the specified memo field from the currently selected database.

The line number to extract is specified by lineno and starts at 1 and has a maximum of MEMO_MLCOUNT()

The line length of the memo field is defined with the Recital command SET MEMOWIDTH TO. The MEMOWIDTH is also affected by the setting of the Recital command MEMOFORMAT, if ON lines are word wrapped.

NOTE: MEMOFORMAT should be either be left turned on or off. You should not toggle between settings as the formatting in the memo will be lost.


EXAMPLE

The following example will extract each line from a memo field.

#include <stdio.h>
#include "dbapi.h"
 
dbapi_memo_mline()
{
    int	i;
    int	numlines;
    char	memoline[80];
    char	*fieldname;
 
    if (_parinfo(1) == API_CTYPE ) _retc("");
 
    strcpy(fieldname, _parc(1));
    numlines = MEMO_MLCOUNT(fieldname);
 
    for (i=0; i<=numlines; ++i) {
       MEMO_MLINE(fieldname, i, memoline);
       /* other commands */
    }
 
    _retni( numlines );
}


SEE ALSO

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