Difference between revisions of "Dbmemoformat()"

From Recital Documentation Wiki
Jump to: navigation, search
 
 
(2 intermediate revisions by one user not shown)
Line 11: Line 11:
  
 
<input parameters>
 
<input parameters>
int format; /* Memo Format flag, 0 – OFF, 1 – ON */
+
int format; /* Memo Format flag, 0 – OFF, 1 – ON */
  
 
<output parameters>
 
<output parameters>
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">
 
#include "dbl.h"
 
#include "dbl.h"
int dbt; /* .DBT file descriptor */
+
int dbt; /* .DBT file descriptor */
char memo[512]; /* Memo buffer */
+
char memo[512]; /* Memo buffer */
int rc; /* Return code variable */
+
int rc; /* Return code variable */
  
 
rc = dbmemoformat(1)
 
rc = dbmemoformat(1)
Line 43: Line 43:
 
&record[53],
 
&record[53],
 
&record[53]) ! = 0) {
 
&record[53]) ! = 0) {
fprintf(stderr, "Error on [[dbupdm()]]: %dn", 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()