Difference between revisions of "Dbmemoformat()"

From Recital Documentation Wiki
Jump to: navigation, search
 
Line 31: Line 31:
 
==EXAMPLE==
 
==EXAMPLE==
  
This example toggles MEMOFORMAT ON.  The buffer that is to be written to the memo field will be stripped of extra spaces and control characters.
+
This example toggles [[SET MEMOFORMAT||MEMOFORMAT ON]].  The buffer that is to be written to the memo field will be stripped of extra spaces and control characters.
  
 
<code lang="c">
 
<code lang="c">

Revision as of 10:20, 2 April 2009

PURPOSE

toggle memo input formatting


SYNOPSIS

#include "dbl.h"
 
	int	dbmemoformat(format)
 
	<input parameters>
	int	format;			/* Memo Format flag, 0 – OFF, 1 – ON	*/
 
	<output parameters>
	none


RETURN VALUE

The dbmemoformat() function returns 0.


DESCRIPTION

Memo formatting automatically formats memo field data when placed into the file. Spaces and other control characters are stripped if memo format is ON. This function allows access to this characteristic from within the libraries. If the input parameter is 0, function dbputm() and dbupdm() attempt no formatting of memos. Otherwise, those functions strip spaces and control characters.


EXAMPLE

This example toggles |MEMOFORMAT ON. The buffer that is to be written to the memo field will be stripped of extra spaces and control characters.

#include "dbl.h"
	int	dbt;				/* .DBT file descriptor	*/
	char	memo[512];			/* Memo buffer		*/
	int	rc;				/* Return code variable	*/
 
	rc = dbmemoformat(1)
	if( rc = dbupdm(dbt, memo,
				&record[53],
				&record[53]) ! = 0) {
		fprintf(stderr, "Error on [[dbupdm()]]: %dn", rc);
		exit(1);
	}


SEE ALSO

dbgetm(), dbmopen(), dbputm(),dbupdm()