[fpc-pascal] TProcess and EProcess

Adrian Maier adrian.maier at gmail.com
Wed Mar 15 09:34:39 CET 2006


Hello,

I am trying to catch the possible exceptions that may ocur
when executing processes with TProcess (such as cases when
the program doesn't exist or is not in the path).

   try
      p := TProcess.Create(nil);
      p.CommandLine := 'psql';
      p.Options := p.Options + [poStderrToOutPut,poNewConsole,poWaitOnExit];
      p.Execute;

   except
      on EProcess do ShowMessage('EProcess !');
      else
         ShowMessage('Mysterious exception, other than EProcess ...' );
   end;

The compiler tells me that it doesn't recognize EProcess.
What am I doing wrong?


Thanks,
Adrian Maier



More information about the fpc-pascal mailing list