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

  1. #include <stdio.h>
  2. #include "pxengine.h"
  3.  
  4. #define TABLENAME            "table"
  5. #define MAXSIZE              128                /* in Megabytes */
  6.  
  7. char *fields[] = {"Numeric Field", "Alpha Field", "Date Field",
  8.                   "Currency Field", "Short Field"};
  9. char *types[] = {"N", "A50", "D", "$", "S"};
  10.     
  11. #define NFIELDS    (sizeof(fields) / sizeof(char *))
  12.  
  13. int main(void)
  14. {
  15.     int pxErr;
  16.  
  17.     PXInit();
  18.  
  19.     /* Set maximum table size before creating table */
  20.     if ((pxErr = PXTblMaxSize(MAXSIZE)) != PXSUCCESS)
  21.         printf("%s\n", PXErrMsg(pxErr));
  22.     
  23.     PXTblCreate(TABLENAME, NFIELDS, fields, types);
  24.     PXExit();
  25.     return(pxErr);
  26. }
  27.