program PX_Exit;
uses PXEngine, WinCrt;


var   PxErr: Integer;

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

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

  (* Try and close Paradox environment *)
  PxErr := PXExit;
  if PxErr <> PxSuccess then
    Writeln(PxErrMsg(PxErr))
  else Writeln('Engine terminated.');
end.
