Difference between revisions of "Dbdo()"
From Recital Documentation Wiki
		
		
		
| Yvonnemilne  (Talk | contribs) | Yvonnemilne  (Talk | contribs)  | ||
| Line 12: | Line 12: | ||
| 	<input parameters> | 	<input parameters> | ||
| 	char	*program;		/* Address of a buffer containing a RECITAL program name to execute	*/ | 	char	*program;		/* Address of a buffer containing a RECITAL program name to execute	*/ | ||
| − | 	char	*parameters;	 | + | 	char	*parameters;	/* Address of a buffer containing up to nine parameters separated with commas that will be passed to program	*/ | 
| 	<output parameters> | 	<output parameters> | ||
| Line 41: | Line 41: | ||
| 	rc = dbdo(program , "para1, para2, para3"); | 	rc = dbdo(program , "para1, para2, para3"); | ||
| 	if (rc != SUCCESS){ | 	if (rc != SUCCESS){ | ||
| − | 		printf("error no %d n", rc); | + | 		printf("error no %d \n", rc); | 
| 		exit(1); | 		exit(1); | ||
| 	} | 	} | ||
Revision as of 15:59, 3 April 2009
PURPOSE
execute a RECITAL program
SYNOPSIS
#include "dbl.h" int dbdo(program, parameters) <input parameters> char *program; /* Address of a buffer containing a RECITAL program name to execute */ char *parameters; /* Address of a buffer containing up to nine parameters separated with commas that will be passed to program */ <output parameters> none
RETURN VALUE
The dbdo() function returns 0 for success or < 0 if an error occurs. See the section on return code values for a detailed list of return codes.
DESCRIPTION
The dbdo() function executes a RECITAL program specified in the buffer. Up to nine parameters may be passed to the RECITAL program. Each parameter must be separated by a comma. The parameters will be defined as public and will be named "_PARA1" through "_PARA9" in RECITAL.
EXAMPLE
The following example runs a RECITAL program called "accounts.prg" passing three parameters.
#include "dbl.h" int rc; static char program[] = "accounts.prg"; rc = dbdo(program , "para1, para2, para3"); if (rc != SUCCESS){ printf("error no %d \n", rc); exit(1); }
