C
canoebee
Unregistered / Unconfirmed
GUEST, unregistred user!
我写了异常处理,为什么Delphi6.0还要报错呢?
Procedure TForm1.Button1Click(Sender :TObject);
var
Num: Integer;
Begin
Try
begin
Num:=StrToInt(Edit1.Text);
Edit2.Text:=IntToStr(30 div Num);
end
Except
On EConvertError Do
ShowMessage(Edit1.Text+'无法转成整数!');
On EDivByZero Do
Begin
ShowMessage('除数不能为零!');
Edit2.Text:='0';
End;
End;
raised [简明英汉词典]
[reizd]
adj.凸起的, 浮雕的, 有凸起花纹的, 发酵的
-
Project Project1.exe raised exception class EDivByZero with message 'Division by zero'.
谢谢在家了!!!~~~
Procedure TForm1.Button1Click(Sender :TObject);
var
Num: Integer;
Begin
Try
begin
Num:=StrToInt(Edit1.Text);
Edit2.Text:=IntToStr(30 div Num);
end
Except
On EConvertError Do
ShowMessage(Edit1.Text+'无法转成整数!');
On EDivByZero Do
Begin
ShowMessage('除数不能为零!');
Edit2.Text:='0';
End;
End;
raised [简明英汉词典]
[reizd]
adj.凸起的, 浮雕的, 有凸起花纹的, 发酵的
-
Project Project1.exe raised exception class EDivByZero with message 'Division by zero'.
谢谢在家了!!!~~~