我在书上看到了这两种类型,可是我在程序中定义了这两种类型的变量:
定义如下:
interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Shape1: TShape;
Shape2: TShape;
Shape4: TShape;
Shape3: TShape;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Timer1: TTimer;
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure DetectEvent();
private
{ Private declarations }
public
hComm:THandle;
{ Public declarations } end;var
Form1: TForm1;
Comm1:TComm;
wEvent:Tevent;
implementation可程序运行调试时却出错了,出错信息如下:
[Error] Unit1.pas(35): Undeclared identifier: 'TComm'
[Error] Unit1.pas(36): Undeclared identifier: 'Tevent'
[Error] Unit1.pas(85): Undeclared identifier: 'TWaitResult'
[Error] Unit1.pas(88): Missing operator or semicolon
[Error] Unit1.pas(88): Too many actual parameters
[Error] Unit1.pas(88): Too many actual parameters
[Fatal Error] Project2.dpr(5): Could not compile used unit 'Unit1.pas'请大家帮我看看这是怎么回事?
定义如下:
interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Shape1: TShape;
Shape2: TShape;
Shape4: TShape;
Shape3: TShape;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Timer1: TTimer;
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure DetectEvent();
private
{ Private declarations }
public
hComm:THandle;
{ Public declarations } end;var
Form1: TForm1;
Comm1:TComm;
wEvent:Tevent;
implementation可程序运行调试时却出错了,出错信息如下:
[Error] Unit1.pas(35): Undeclared identifier: 'TComm'
[Error] Unit1.pas(36): Undeclared identifier: 'Tevent'
[Error] Unit1.pas(85): Undeclared identifier: 'TWaitResult'
[Error] Unit1.pas(88): Missing operator or semicolon
[Error] Unit1.pas(88): Too many actual parameters
[Error] Unit1.pas(88): Too many actual parameters
[Fatal Error] Project2.dpr(5): Could not compile used unit 'Unit1.pas'请大家帮我看看这是怎么回事?
wEvent:Tevent;
找不到这样的类型,可能是他自己定义的类型