Difference between revisions of "Dbset()"

From Recital Documentation Wiki
Jump to: navigation, search
 
Line 12: Line 12:
 
<input parameters>
 
<input parameters>
  
char *keyword; /* Address of buffer containing SET keyword */
+
char *keyword; /* Address of buffer containing SET keyword */
int value; /* Value to set, 1 for on/true, 0 for off/false */
+
int value; /* Value to set, 1 for on/true, 0 for off/false */
 
 
 
<output parameters>
 
<output parameters>
Line 42: Line 42:
 
#include "dbl.h"
 
#include "dbl.h"
  
int rc; /* Return code */
+
int rc; /* Return code */
 
 
 
rc = dbset("EXACT",1);
 
rc = dbset("EXACT",1);
 
if ( rc != 0 )  {
 
if ( rc != 0 )  {
printf("Error setting exact on; %dn", rc);
+
printf("Error setting exact on; %d\n", rc);
 
exit(1);
 
exit(1);
 
} else {
 
} else {
printf("Exact set on!n");
+
printf("Exact set on!\n");
 
}
 
}
  

Latest revision as of 15:16, 1 May 2009

PURPOSE

issue a Recital Set Command


SYNOPSIS

#include "dbl.h"
 
	int	dbset(keyword, value)
 
	<input parameters>
 
	char	*keyword;		/* Address of buffer containing SET keyword */
	int	value;		/* Value to set, 1 for on/true, 0 for off/false */
 
	<output parameters>
 
	none


RETURN VALUE

The dbset() function returns 0 for success. Refer to the section on return codes for a detailed list of return code definitions.


DESCRIPTION

The dbset() function issues a Recital SET command, switching the specified setting 'on' or 'off'.

Note: The dbset() function currently only operates on the SET EXACT command.


EXAMPLE

The following example issues a SET EXACT ON. With SET EXACT OFF, strings are compared up to the length of the shorter string. With SET EXACT ON, the strings compared must be an exact match in both characters and length.

#include "dbl.h"
 
	int	rc;	/* Return code */
 
	rc = dbset("EXACT",1);
	if ( rc != 0 )  {
		printf("Error setting exact on; %d\n", rc);
		exit(1);
	} else {
		printf("Exact set on!\n");
	}


SEE ALSO

dbrun()