Dbrecout()

From Recital Documentation Wiki
Revision as of 14:26, 1 May 2009 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

PURPOSE

split the record buffer into individual field components


SYNOPSIS

#include "dbl.h"
 
	int	dbrecout(dbf, fields, fldpos, buffer, fldbuf)
 
	<input parameters>
	int		*dbffd;			/* Database file descriptor */
	dBFIELD	*fields;			/* Array of record fields */
	int		*fldpos;			/* Array of field offsets */
	char		*buffer;			/* Address of a buffer where record starts */
	char		fldbuf[128][256];	/* Buffers to update from the record */
 
 
	<output parameters>
	none


RETURN VALUE

The dbrecout() 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 dbrecout() function splits a record buffer into its component fields by placing the individual fields into 'fldbuf'. The 'fields' and 'fldpos' are provided by The dbgetfx() function.


EXAMPLE

This example splits the record "dBFIELD fields" with ASCII information stored in "char fieldbuf[128][256]".

#include "dbl.h"
 
	char		*dbf;				/* .DBF file descriptor */
	dBFIELD	fields[128];		/* Return code */
	int		fieldpos[128];		/* Field positions */
	char		record[1000];		/* Record buffer */
	char		fieldbuf[128][256];	/* Field buffers */
 
	rc = dbrecout(dbf, fields, fieldpos, record, fieldbuf);
	if (rc == SUCCESS) printf("record filled \n");
	else {
		printf("error number %d \n", rc);
		exit (1);
	}


SEE ALSO

dbgather(), dbgetfx(), dbgetr(), dbrecin(), dbscatter()