program HardErr;
uses PXEngine, WinCrt;

var   PxErr: Integer;
      TblHandle: TableHandle;

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

begin
  (* Enable hardware handler so functions, rather than DOS, return errors *)
  PxErr := PXSetHWHandler(True);
  if PxErr <> PxSuccess then
    Writeln(PxErrMsg(PxErr));

  PX(PXWinInit('MyApp', pxShared));
  Writeln('Open drive A: and press return');
  ReadLn;
  while PXTblOpen('A:Table', TblHandle, 0, False) = PXERR_DRIVENOTREADY DO
  begin
    Writeln('Please place disk in drive A:.  Press return when ready');
    ReadLn;
  end;
  PX(PXExit);
end.
