home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a006 / 2.ddi / CEXAM.ZIP / RECLOCK.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-03-11  |  709 b   |  30 lines

  1. #include <stdio.h>
  2. #include "pxengine.h"
  3.  
  4. #define TABLENAME        "table"
  5. #define NETDIR           ""
  6. #define NETTYPE          NOTONNET
  7.  
  8. int main(void)
  9. {
  10.     RECORDHANDLE recHandle;
  11.     TABLEHANDLE tblHandle;
  12.     LOCKHANDLE lckHandle;
  13.     int pxErr;
  14.  
  15.     PXNetInit(NETDIR,NETTYPE,DEFUSERNAME);
  16.     PXTblOpen(TABLENAME, &tblHandle, 0, 0);
  17.     PXRecBufOpen(tblHandle, &recHandle);
  18.  
  19.     /* Attempt to lock current record */
  20.     if ((pxErr = PXNetRecLock(tblHandle, &lckHandle)) != PXSUCCESS)
  21.         printf("%s\n", PXErrMsg(pxErr));
  22.     else
  23.         PXNetRecUnlock(tblHandle, lckHandle);
  24.  
  25.     PXRecBufClose(recHandle);
  26.     PXTblClose(tblHandle);
  27.     PXExit();
  28.     return(pxErr);
  29. }
  30.