Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- SoftC Database Library v2.1 Guide - usage http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
USAGE
   int scddfinfo(
           int handle,
           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 */
     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

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson