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 scdnknext(
           int handle,
           void *key,
           long *recno );

PROTOTYPE IN
   sc_base.h

DESCRIPTION
   scdnknext will increment the key pointer and return the key value
   key and data record number recno associated with the new current
   key.

   If scdnknext is called immediately after opening the index file the
   first logical key will be returned.

NOTES
   The user must ensure that the buffer used to return the key is large
   enough to hold the entire key. The maximum length of the key can be
   determined via a call to scdninfo.

   Numeric keys are returned as doubles, and character keys are returned as
   strings.

EXAMPLE
   /*  Character Key Example     */
   #include <stdio.h>
   #include <softc.h>
   #include <sc_base.h>

   void main()
   {
     int ndx;
     char name[65];
     long recno;

     scdinit(20,0);
     if (scdnopenx(&ndx,"TOCNAME.NDX",SC_BUFFER) == SC_SUCCESS) {
       scdnknext(ndx,name,&recno);    /* return first key */
       printf("%s %ld\n",name,recno);
       scdnclose(ndx);
     }
     scdterm();
   }

   /*  Numeric Key Example  */
   #include <stdio.h>
   #include <softc.h>
   #include <sc_base.h>

   void main()
   {
     int ndx;
     double length;
     long recno;

     scdinit(20,0);
     if (scdnopenx(&ndx,"TOCLNGTH.NDX",SC_BUFFER) == SC_SUCCESS) {
       scdnknext(ndx,&length,&recno); /* return first key */
       printf("%lf %ld\n",length,recno);
       scdnclose(ndx);
     }
     scdterm();
   }

See Also: scdninfo

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