有一个类,编译没有问题,一运行在引用类的时候就会出现运行错误!请教unit GamCtrler;interface type
Tpos=record
x:integer;
y:integer;
nX:integer;
nY:integer;
end; //the point position data structure.{class of tool}
type
Ftool = record
id:integer;
color:String; //the colour of the falling things.
Picname:String;
TNum:integer; // the number of the kuai.
heigh,width:integer; //x x x x
{........The..positions.........}
//begin
K_Array:array of Tpos;
//end.
{........The..positions.........}
end; //ending record of Ftool.
{class of tool..}
type //Class TGamCtrl--------------------------------------------
TGamCtrl=class
private
//is_falling:boolean; //is there somthing falling in display.
//--------
public
w_num:integer;
h_num:integer; //the number of the xx.
{matrix : array of array of integer;
FallTool:Ftool;
//constructor Create;
procedure CreatTool(id:integer);
procedure setRefresh();
procedure init();
}
end;
// end the TGamCtrl class.Define...implementation
end.//======================================================================
//======================================================================
unit eluosi;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ImgList,GamCtrler;type
TForm1 = class(TForm)
Panel1: TPanel;
Button1: TButton;
Image1: TImage;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
// procedure refreshDis();
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
myGame:TGamCtrl;
//.......
bmp:array of TBitmap;
//..define the var of pics..
implementation{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
myGame.create; <==这句出错!!!!end;
Tpos=record
x:integer;
y:integer;
nX:integer;
nY:integer;
end; //the point position data structure.{class of tool}
type
Ftool = record
id:integer;
color:String; //the colour of the falling things.
Picname:String;
TNum:integer; // the number of the kuai.
heigh,width:integer; //x x x x
{........The..positions.........}
//begin
K_Array:array of Tpos;
//end.
{........The..positions.........}
end; //ending record of Ftool.
{class of tool..}
type //Class TGamCtrl--------------------------------------------
TGamCtrl=class
private
//is_falling:boolean; //is there somthing falling in display.
//--------
public
w_num:integer;
h_num:integer; //the number of the xx.
{matrix : array of array of integer;
FallTool:Ftool;
//constructor Create;
procedure CreatTool(id:integer);
procedure setRefresh();
procedure init();
}
end;
// end the TGamCtrl class.Define...implementation
end.//======================================================================
//======================================================================
unit eluosi;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ImgList,GamCtrler;type
TForm1 = class(TForm)
Panel1: TPanel;
Button1: TButton;
Image1: TImage;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
// procedure refreshDis();
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
myGame:TGamCtrl;
//.......
bmp:array of TBitmap;
//..define the var of pics..
implementation{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
myGame.create; <==这句出错!!!!end;
myGame:=TGameCtrl.Create;
var
Form1: TForm1;
myGame:TGamCtrl;
//.......
bmp:array of TBitmap;