Y
yesye
Unregistered / Unconfirmed
GUEST, unregistred user!
下面是我的错误测试程序,但不知道为什么没有存盘倒没有任何错误,但一存盘后就出现下面
的错误,不知道是什么原因?
unit Exception;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure AppError(Sender:TObject;E:Exception);
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
procedure TForm1.AppError(Sender:TObject;E:Exception);
begin
ShowMessage('error');
end;
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
//Application.OnException:=AppError;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i,j:integer;
begin
//
j:=10;
i:=10 div (j-10);
end;
end.
错误代码如下:
[Error] Exception.pas(12): '.' expected but ')' found
[Error] Exception.pas(13): Identifier expected but 'PROCEDURE' found
[Error] Exception.pas(26): '.' expected but ')' found
[Error] Exception.pas(27): Identifier expected but 'BEGIN' found
[Fatal Error] ExceptPro.dpr(5): Could not compile used unit 'Exception.pas'
的错误,不知道是什么原因?
unit Exception;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure AppError(Sender:TObject;E:Exception);
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
procedure TForm1.AppError(Sender:TObject;E:Exception);
begin
ShowMessage('error');
end;
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
//Application.OnException:=AppError;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i,j:integer;
begin
//
j:=10;
i:=10 div (j-10);
end;
end.
错误代码如下:
[Error] Exception.pas(12): '.' expected but ')' found
[Error] Exception.pas(13): Identifier expected but 'PROCEDURE' found
[Error] Exception.pas(26): '.' expected but ')' found
[Error] Exception.pas(27): Identifier expected but 'BEGIN' found
[Fatal Error] ExceptPro.dpr(5): Could not compile used unit 'Exception.pas'