用try ... except...end,如果错误信息不能用前面的方法捕获,可惜如下代码实现
procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnException := AppException;
end;
procedure TForm1.AppException(Sender: TObject
E: Exception);
begin
showmessage('关键字不能重复');
abort;
end;
procedure AppException(Sender: TObject
E: Exception);
必须定义载创体类中