各位朋友,我是个新手,现在用的是本案例的书,很多东西不是很清楚,请各前辈指点,另不知还有什么书更合适的,以下是我在编译连接时,总是说是错的,提示为
[错误]unit1.pas(34):undeclared identifier;'form2'
[错误]unit1.pas(38):undeclared identifier:'form3'
[致命错误]project1.dpr(7):could not compile used unit'unit1.pas'procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
form2.showmodal;
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
form3.show;
end;
end.
谢谢!!!
[错误]unit1.pas(34):undeclared identifier;'form2'
[错误]unit1.pas(38):undeclared identifier:'form3'
[致命错误]project1.dpr(7):could not compile used unit'unit1.pas'procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
form2.showmodal;
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
form3.show;
end;
end.
谢谢!!!
解决方案 »
- 关于string中公式的计算!
- 如何把多个单sheet的excel合并成一个多sheet的excel,高分求教!
- 有什么好的治胃病的方法吗?
- 我做得ActiveXForm怎么在网上发布!
- 动态创建表为何出错?在线等待!在线给分!
- 怎样用程序在BDE中设别名设定??
- 动态生成的tqrchart为什么不能ASSIGN给它一个Tdbchart的?
- 图片存储问题
- 急急急 请告知delphi6试用版的serial number 和authorization key
- zswang(伴水)(需要充充电) 帮帮我!!!
- delphi组合框所返回的值是什么类型的呀?
- 一个出血者的问题:为什么我点右键没有弹出菜单.
uses unit2,unit3;
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
if not assigned(form2) then
form2:=Tform2.create(self);
try
form2.showmodal;
finally
freeandnil(form2);
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
if not assigned(form3) then
form3:=Tform3.create(self);
form3.show;
end;procedure TForm1.ondestroy(Sender: TObject);
begin
freeandnil(form3);
end;
uses unit2,unit3;//在实现部分引用unit2,unit3单元文件
就必须在Form1中引用Form2和Form3所在单元在implemention下面加上
uses Unit2,Unit3;
或者加到最开始的uses中procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
form2.showmodal;
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
form3.show;
end;
end.