Re: [fpc-pascal] Catching exception generated by another program

2009-06-15 Thread Jonas Maebe
On 15 Jun 2009, at 07:45, leledumbo wrote: Suppose I have a program written in C: #include int main() { return 1 / 0; } and a Pascal program that calls it: program prog; {$mode objfpc}{$H+} uses SysUtils; begin try ExecuteProcess('tes.exe',''); except on e: Exception do begin

[fpc-pascal] Catching exception generated by another program

2009-06-14 Thread leledumbo
Suppose I have a program written in C: #include int main() { return 1 / 0; } and a Pascal program that calls it: program prog; {$mode objfpc}{$H+} uses SysUtils; begin try ExecuteProcess('tes.exe',''); except on e: Exception do begin WriteLn(e.Message); end; end