procedure TFormMain.FormCreate(Sender: TObject);
var
MyIniFile :TIniFile;
mySolutionIniFile :string;
begin
mySolutionIniFile := ExtractFilePath(Application.ExeName) + 'NetConfig.ini';
try
MyIniFile := TIniFile.Create(mySolutionIniFile);
cmbx_FormStyle.ItemIndex := MyIniFile.ReadInteger('系统配置','cmbx_FormStyle',1);
cmbx_SolutionList.ItemIndex := cmbx_SolutionList.Properties.Items.IndexOf(MyIniFile.ReadString('系统配置','cmbx_SolutionList',''));
finally
MyIniFile.Free;
end;
end;
为何我这样写会出现“[Warning] frmMain.pas(171): Variable 'MyIniFile' might not have been initialized”这样的警告呢?怎样才能消除这个警告啊?
var
MyIniFile :TIniFile;
mySolutionIniFile :string;
begin
mySolutionIniFile := ExtractFilePath(Application.ExeName) + 'NetConfig.ini';
try
MyIniFile := TIniFile.Create(mySolutionIniFile);
cmbx_FormStyle.ItemIndex := MyIniFile.ReadInteger('系统配置','cmbx_FormStyle',1);
cmbx_SolutionList.ItemIndex := cmbx_SolutionList.Properties.Items.IndexOf(MyIniFile.ReadString('系统配置','cmbx_SolutionList',''));
finally
MyIniFile.Free;
end;
end;
为何我这样写会出现“[Warning] frmMain.pas(171): Variable 'MyIniFile' might not have been initialized”这样的警告呢?怎样才能消除这个警告啊?
解决方案 »
- RichEdit 如何快速转跳到指定行?
- TShockwaveFlash怎用啊
- 請熟悉Delphi BPL包的朋友給我一些幫助.
- combobox,listbox控件如何获得一个字段的两个值,在线。。。。。。
- 如何获取internet中的IP地址?
- 高人们!!!事务处理
- 今天在深圳参加招聘会,手机被偷了,工作没着落,心哭啊,大家来聊聊。
- DELPHI打包问题:BDE打包,进行安装,程序启动找不到BDE,手工设置BDE ,程序能够正常运行,不知何因?在线等待!.
- 初学com那位知情者,给个简单事例,20个十分感谢
- 苦苦寻觅Delphi开发的ActiveX的源码!不知那个网站上有?知道或有的神仙请进来!
- Borland出售IDE部门的事怎么样了?Delphi下一步会怎么走?
- 关于Wise Installation System 9.02的问题
var
MyIniFile :TIniFile;
mySolutionIniFile :string;
begin
mySolutionIniFile := ExtractFilePath(Application.ExeName) + 'NetConfig.ini';
MyIniFile := TIniFile.Create(mySolutionIniFile);
try
cmbx_FormStyle.ItemIndex := MyIniFile.ReadInteger('系统配置','cmbx_FormStyle',1);
cmbx_SolutionList.ItemIndex := cmbx_SolutionList.Properties.Items.IndexOf(MyIniFile.ReadString('系统配置','cmbx_SolutionList',''));
finally
MyIniFile.Free;
end;
end;