Handle exception sometimes by my own

delphi package - automated exception handling
Post Reply
Stef
Posts: 6
Joined: Wed Feb 14, 2007 9:36 am

Handle exception sometimes by my own

Post by Stef »

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 »

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 »

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
Post Reply