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

  1. #include <stdio.h>
  2. #include "pxengine.h"
  3.  
  4. #define TABLENAME            "table"
  5.  
  6. char *fields[] = {"Numeric Field", "Alpha Field", "Date Field", 
  7.                   "Currency Field", "Short Field"};
  8.  
  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.     /* Create a new table */
  20.     if ((pxErr = PXTblCreate(TABLENAME, NFIELDS, fields, types)) != PXSUCCESS)
  21.         printf("%s\n", PXErrMsg(pxErr));
  22.  
  23.     PXExit();
  24.     return(pxErr);
  25. }
  26.