delphi package - automated exception handling
Stef
Posts: 6 Joined: Wed Feb 14, 2007 9:36 am
Post
by Stef » Wed Feb 14, 2007 9:46 am
Hi,
Suppose I have some code where I know it will generate an exception. Because the exception isn't important at all I don't want to bother an enduser with a MasExcept exception-screen.
Currently I handle it like:
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
var TempInt, aInt : Integer;
begin
try
TempInt := 0
aInt := 0;
TempInt := TempInt div aInt;
except
end;
end;
How can I handle this with MadExcept. Could you please give me some example.
Thanks, Stef
madshi
Site Admin
Posts: 10766 Joined: Sun Mar 21, 2004 5:25 pm
Post
by madshi » Wed Feb 14, 2007 1:47 pm
madExcept only cares about *unhandled* exceptions. So the code you posted should work exactly like you're used to.
Stef
Posts: 6 Joined: Wed Feb 14, 2007 9:36 am
Post
by Stef » Wed Feb 14, 2007 3:20 pm
Apparently I did something wrong the first time, but after another test I saw that you are very right.
Thanks for the quick reply though.
Regards,
Stef