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 scddrlock(
           int handle,
           long record );

PROTOTYPE IN
   sc_base.h

DESCRIPTION
   scddrlock will lock the specified record in the data file for
   exclusive use by this station. This function should be used immediately
   prior to updating a data file record. A call to scddunlock should
   immediately follow the write so that others may again access the data
   record.

   File sharing is enabled by opening the data file with SC_SHARED in the
   command switch.

EXAMPLE
   #include <stdio.h>
   #include <softc.h>
   #include <sc_base.h>

   void main()
   {
     int dbf;
     long record = 1L;
     double length = 1936, attribute = 1;
     scdinit(20,0);
     if (scddopenx(&dbf,"TOC.DBF",SC_SHARED) == SC_SUCCESS) {
       scddfput(dbf,0,"MNO.XYZ");
       scddfput(dbf,1,&length);
       scddfput(dbf,2,"07/22/90");
       scddfput(dbf,3,"20:10:45");
       scddfput(dbf,4,&attribute);
       scdnkmake(dbf,ndx,&key);
       scdrlock(dbf,record);
       scddrput(dbf,&record,SC_UPDATE);
       scddunlock(dbf);
       free(key);
       scddclose(dbf);
     }
     scdterm();
   }

See Also: scddopenx scddlock scddunlock

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