关于变量调用的问题,急~~在线等哦 我在unit1中,定义了一个串的的变量,是在Public里面定义的,我想在unit2中使用,可是却用不了。不知道是不是对于一个工程,我的公用变量定义位置错误了,还是,有别的什么原因啊,我好郁闷!!!大家帮个忙了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不可以的你得在UNIT1中的USES UNIT2,,然后在UNIT2中的IMP。部分 UESE UNIT1就可以了, 楼上的弟兄,谢谢你,能不能把代码贴上,在unit1中,我也说明了要引用Unit2的,可是您说的UNIT2中的IMP。部分 UESE UNIT1 我不知道在哪里,现在我在网吧,没有办法开DELPHI啊,谢谢你了,谢谢 在Implimetation的下面添加uses Unit2; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation-----------:就是这个,实现部分 unit Unit2;interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;type TForm2 = class(TForm) procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } var2:string; end;var Form2: TForm2;implementationuses unit1;//{$R *.DFM}end.unit Unit1;interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,Unit2;type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } var1:string; end;var Form1: TForm1;implementation{$R *.DFM}end. 只因为你定义的并非全局变量,你定义的只是窗体的成员所以要用Form2.xxx的方法引用 谢谢大家,这回我明白了,看来DELPHI的入门还要走好长的时间啊,我会经常来向前辈们请教的,:)谢谢了.今天是3.8节,祝前辈们的女朋友或则老婆节日快乐,:).thanks delphi 里面的有没excel 里的STDEV函数? 加载三层树的问题 哪里有FOR XP 的MDAC2.8 下载??MICROSOFT没找到:( 如何隐藏MDI子窗体? 超级变态问题 有没有办法改变窗体标题栏的高度? ado的query查询没有返回结果(给40分) 请问padarox的数据表必须有索引么,如果建立的时候没有索引,系统是否自动将第一个字段作为索引 edit.text的汉字内容不能全部传导数据库中。但是一个汉字加上字母可以添加进去! 这个问题邪门了,谁知道立马送200分 哪里有用Delphi做的数据库实例下载? 如何把异常的消息截获并保存到文本里?
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation-----------:就是这个,实现部分
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;type
TForm2 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
var2:string;
end;var
Form2: TForm2;implementation
uses unit1;//
{$R *.DFM}
end.unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,Unit2;type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
var1:string;
end;var
Form1: TForm1;implementation{$R *.DFM}end.