我的代码:
procedure TForm1.Button1Click(Sender: TObject); var number, zero : Integer;
begin // Try to divide an integer by zero - to raise an exception
try
zero := 0;
number := 1 div zero;
ShowMessage('number / zero = '+IntToStr(number));
except
on E : Exception do
ShowMessage(E.ClassName+' error raised, with message : '+E.Message);
end;
end;
显示:
并且不显示我的ShowMessage。