program TblExits;
uses PXEngine, WinCrt, WinTypes;

const TableName = 'Table';

var   PxErr: Integer;
      Exist: Bool;

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

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

  (* See if table exists *)
  PxErr := PXTblExist(TableName, Exist);
  if PxErr <> PxSuccess then
    Writeln(PxErrMsg(PxErr))
  else if Exist then
         Writeln('Table exists')
       else Writeln('Table does not exist');

  PX(PXExit);
end.
