.......
implementation
uses unit1,iniFiles;{$R *.DFM}
procedure TForm2.BitBtn2Click(Sender: TObject);
var
mima:TIniFile;
str:string;
begin
try
mima:=TIniFile.create('c:\住房管理系统\password.ini');
str:=mima.ReadString('password','password',str);
finally
mima.Free;
end; if edit2.Text=str
then begin
application.ProcessMessages; //?
Application.CreateForm(TForm1, Form1);
form2.Hide;
form2.Free;
form1.Show;
form1.Update; //?
end
else begin
showmessage('住户登录口令错误,请重新输入 !!!');
edit2.Clear;
form2.ActiveControl:=edit2;
bitbtn2.Enabled:=false;
end;
end;
.........
上述程序段按F9运行系统提示“[Warning] Unit2.pas(43): Variable 'mima' might not have been initialized”这是什么缘故,是不是要对“Project”文件做些改动?
还有如何给回复者分数?[:)]
implementation
uses unit1,iniFiles;{$R *.DFM}
procedure TForm2.BitBtn2Click(Sender: TObject);
var
mima:TIniFile;
str:string;
begin
try
mima:=TIniFile.create('c:\住房管理系统\password.ini');
str:=mima.ReadString('password','password',str);
finally
mima.Free;
end; if edit2.Text=str
then begin
application.ProcessMessages; //?
Application.CreateForm(TForm1, Form1);
form2.Hide;
form2.Free;
form1.Show;
form1.Update; //?
end
else begin
showmessage('住户登录口令错误,请重新输入 !!!');
edit2.Clear;
form2.ActiveControl:=edit2;
bitbtn2.Enabled:=false;
end;
end;
.........
上述程序段按F9运行系统提示“[Warning] Unit2.pas(43): Variable 'mima' might not have been initialized”这是什么缘故,是不是要对“Project”文件做些改动?
还有如何给回复者分数?[:)]
implementation
uses unit1,iniFiles;
的iniFiles放到最开头的uses处(即interface后面的uses)
Application.Initialize;
Form2:=TForm2.Create(Application);
Form2.Show;
Form2.Update;
//sleep(2000);
Application.Title := 'xxxx';
Application.CreateForm(TForm1, Form1);
Application.CreateForm(...//省略,创建其它窗体)
Form2.Hide;
Form2.Close;
Application.Run;
implementation
uses unit1,iniFiles;
的iniFiles放到最开头的uses处(即interface后面的uses)
=============
Application.CreateForm(TForm1, Form1);//用错误吧,应该是在工程文件里写的啊,
//动态创建窗体如下Form1:=Tform1.create(self)