想在frame_sell中获得另一个窗体form1(或Tfrm_coustom_zkb)的参数,编译时出错!
procedure Tfrm_coustom_zkb.DBGrid1DblClick(Sender: TObject);
var
txt1:string;
frm_sell:tframesell;
begin
txt1:=DBGrid1.DataSource.DataSet.Fields[0].AsString;
//txt2:=DBGrid1.DataSource.DataSet.Fields[0].AsString;
frm_sell.DBEdit1.Text:=txt1;
self.Close;
end;编译提醒:[Warning] zkb.pas(94): Variable 'frm_sell' might not have been initialized
procedure Tfrm_coustom_zkb.DBGrid1DblClick(Sender: TObject);
var
txt1:string;
frm_sell:tframesell;
begin
txt1:=DBGrid1.DataSource.DataSet.Fields[0].AsString;
//txt2:=DBGrid1.DataSource.DataSet.Fields[0].AsString;
frm_sell.DBEdit1.Text:=txt1;
self.Close;
end;编译提醒:[Warning] zkb.pas(94): Variable 'frm_sell' might not have been initialized
说的很明白了变量'frm_sell'可能没初始化。
可是两个frm 都在mainform中,我从量'frm_sell'的button1.click事件中切换到量frm_zhk,去取
txt1:=DBGrid1.DataSource.DataSet.Fields[0].AsString;
,有什么好的解决办法么?
frm_sell.parent:=self;
...
这一句去掉的话,我想依你的程序也不会出什么问题吧。
[Error] Unit_prod_sel.pas(114): Undeclared identifier: 'FrameSell'
[Fatal Error] UnitSell.pas(88): Could not compile used unit 'Unit_prod_sel.pas'
可是我在uses中都已经引用了呀,高手呢?跑妞了?