Difference between revisions of "Dbscatter()"

From Recital Documentation Wiki
Jump to: navigation, search
 
Line 31: Line 31:
 
==DESCRIPTION==
 
==DESCRIPTION==
  
The dbscatter() function "scatters" the specified record, retrieved with [[dbgetr()]]/[[dbgetrk()]], into individual field buffers.  The command is similar to The dbrecout() function with the exception that it requires fewer input parameters.
+
The dbscatter() function "scatters" the specified record, retrieved with [[dbgetr()]] / [[dbgetrk()]], into individual field buffers.  The command is similar to The dbrecout() function with the exception that it requires fewer input parameters.
 +
 
  
 
==EXAMPLE==
 
==EXAMPLE==

Revision as of 09:52, 2 April 2009

PURPOSE

split the record buffer into individual field buffers


SYNOPSIS

#include "dbl.h"
 
	int	dbscatter(dbf, record, fldbuf)
 
	<input parameters>
 
	char	*dbf;			/* Database file descriptor	*/
	char	record[1000];		/* Record buffer		*/
	char	fldbuf[128][256];	/* Field buffers to fill		*/
 
	<output parameters>
 
	none


RETURN VALUE

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


DESCRIPTION

The dbscatter() function "scatters" the specified record, retrieved with dbgetr() / dbgetrk(), into individual field buffers. The command is similar to The dbrecout() function with the exception that it requires fewer input parameters.


EXAMPLE

The following example "scatters" the record stored in 'char record[1000]' into the specified field buffers (fldbuf[128][256]).

#include "dbl.h"
 
	char	*dbf;			/* Database file descriptor	*/
	char	record[1000];		/* Record buffer		*/
	char	fldbuf[128][256];	/* Field buffers to fill		*/
 
	rc = dbscatter(dbf, record, fldbuf);
	if ( rc != 0 )  {
		printf("Error scattering record; %dn", rc);
		exit(1);
	} else {
		printf("Record scattered!n");
	}

</code>


SEE ALSO

dbfield(), dbgather(), dbgetr(), dbgetrk(), dbrecout()