[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
USAGE
signed int scddfinfo(
signed int handle,
signed int *longfldlen,
SC_FIELD *fields );
PROTOTYPE IN
sc_base.h
DESCRIPTION
scddfinfo copies the data field descriptions to fields using the
structure SC_FIELD. The length of the longest data field is also
returned in longfldlen.
NOTES
The user must ensure that the array defined for fields is large enough
to hold all of the field descriptions because scddfinfo blindly copies the
descriptions to fields. Severe program errors can be the result if the
field array is too small. Use scddrinfo to determine the number of
fields in the data record.
EXAMPLE
#include <stdio.h>
#include <softc.h>
#include <sc_base.h>
void main()
{
int dbf, longfld, numflds, a, reclen;
SC_FIELD fields[128]; /* dBASEIII max size */
unsigned char *bfr;
SC_DBFRINFO rinfo;
scdinit(20,0);
if (scddopenx(&dbf,"TOC.DBF",0) == SC_SUCCESS) {
scddrinfo(dbf,&rinfo);
scddfinfo(dbf,&longfld,fields);
printf("longest field length = %d\n",longfld);
for (a=0; a<rinfo.numflds; a++)
printf("%s %c %d %d\n", fields[a].name, fields[a].type,
fields[a].len, fields[a].decpl);
scddclose(dbf);
}
scdterm();
}
See Also:
scddrinfo
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson