program TblMaxSz;
uses PXEngine, WinCrt;

type NameString = pChar;

const TableName = 'Table';
      MaxSize	= 128;		 (* in Megabytes *)
      NFields	= 5;
      Fields: Array[1..NFields] of NameString =
               ('Numeric Field', 'Alpha Field', 'Date Field', 'Currency Field',
                'Short Field');
      Types: Array[1..NFields] of NameString =
               ('N', 'A50', 'D', '$', 'S');

var   PxErr: Integer;

procedure PX(Code : integer);
begin
  writeln(PXErrMsg(Code));
end;

begin
  PX(PXWinInit('MyApp', pxShared));

  (* Set maximum table size before creating table *)
  PxErr := PXTblMaxSize(MaxSize);
  if PxErr <> PxSuccess then
    Writeln(PxErrMsg(PxErr));

  PX(PXTblCreate(TableName, NFields, Fields, Types));
  PX(PXExit);
end.
