想在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

解决方案 »

  1.   

    Variable 'frm_sell' might not have been initialized
    说的很明白了变量'frm_sell'可能没初始化。
      

  2.   

    变量'frm_sell'可能没初始化?
    可是两个frm 都在mainform中,我从量'frm_sell'的button1.click事件中切换到量frm_zhk,去取
    txt1:=DBGrid1.DataSource.DataSet.Fields[0].AsString;
    ,有什么好的解决办法么?
      

  3.   

    这个过程中定义的frm_sell变量没有赋值
      

  4.   

    只不过一个Warning而已,以不是Error,没什么可担心的呀!!
      

  5.   

    frm_sell:=Tfrm_sell.create(nil);
    frm_sell.parent:=self;
    ...
      

  6.   

    frm_sell:tframesell;
    这一句去掉的话,我想依你的程序也不会出什么问题吧。
      

  7.   

    问题还没有解决呀!
    [Error] Unit_prod_sel.pas(114): Undeclared identifier: 'FrameSell'
    [Fatal Error] UnitSell.pas(88): Could not compile used unit 'Unit_prod_sel.pas'
    可是我在uses中都已经引用了呀,高手呢?跑妞了?