program GetDef;
uses PXEngine, WinCrt;

var   PxErr: Integer;
      sortTable: Char;
      MaxSwapsizevar,
      MaxTableHandlesvar,
      MaxRecBufsvar,
      MaxLockHandlesvar,
      MaxFileHandlesvar: Integer;

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

begin
  PX(PXSetDefaults(MaxSwapSize, MaxTableHandles, PxDefault,
		    MaxLockHandles, MaxFileHandles, DefSortOrder));

  (* Retrieve the current defaults. *)
  PxErr := PXGetDefaults(MaxSwapsizevar, MaxTableHandlesvar, MaxRecBufsvar,
		       MaxLockHandlesvar, MaxFileHandlesvar, sortTable);
  if PxErr <> PxSuccess then
    Writeln(PxErrMsg(PxErr))
  else begin
       Writeln('Swap Size: ', MaxSwapsizevar);
       Writeln('Table Handles: ', MaxTableHandlesvar);
       Writeln('Record Buffers: ', MaxRecBufsvar);
       Writeln('Lock Handles: ', MaxLockHandlesvar);
       Writeln('File Handles: ', MaxFileHandlesvar);
       write  ('Sort order: ');
       if sortTable = DefSortOrder then Writeln('System Default')
       else if sortTable = 'a' then Writeln('ascii')
       else if sortTable = 'i' then Writeln('international')
       else if sortTable = 'n' then Writeln('Norwegian/Danish')
       else if sortTable = 's' then Writeln('Swedish/Finish');
       end;
end.
