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

  1. #include <stdio.h>
  2. #include "pxengine.h"
  3. main(void)
  4. {
  5.   TABLEHANDLE tblHandle;
  6.   RECORDHANDLE recHandle;
  7.   int i;
  8.   int pxErr;
  9.  
  10.   PXInit();
  11.   PXTblOpen("table",&tblHandle,0,0);
  12.   PXRecBufOpen(tblHandle,&recHandle);
  13.   for (i=0;i<10;++i)
  14.   {
  15.       PXPutDoub(recHandle,1,(double) i);
  16.       PXRecAppend(tblHandle,recHandle);
  17.  
  18.       /* Save the table to disk every fifth append */
  19.       if (i % 5)
  20.           if ((pxErr = PXSave()) != PXSUCCESS)
  21.               printf("%s\n",PXErrMsg(pxErr));
  22.     }
  23.     PXRecBufClose(recHandle);
  24.     PXTblClose(tblHandle);
  25.     PXExit();
  26.     return(pxErr);
  27. }
  28.  
  29.  
  30.