Difference between revisions of "Dbmemoformat()"

From Recital Documentation Wiki
Jump to: navigation, search
 
Line 43: Line 43:
 
&record[53],
 
&record[53],
 
&record[53]) ! = 0) {
 
&record[53]) ! = 0) {
fprintf(stderr, "Error on [[dbupdm()]]: %d\n", rc);
+
fprintf(stderr, "Error on dbupdm(): %d\n", rc);
 
exit(1);
 
exit(1);
 
}
 
}

Latest revision as of 13:47, 1 May 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(): %d\n", rc);
		exit(1);
	}


SEE ALSO

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