TIniFile Problem

Giganews Newsgroups
Subject: TIniFile Problem
Posted by:  Monzer George Yazigi (monzer_yazi…@hotmail.com)
Date: Sat, 28 Jun 2008

Dear All
I am facing a strange problem. I could not figure it out. it might be so
simple that I could not see.

I have the following code, which create an INI file variable, and read a
section out of the INI file. edAttach and edPicsPath are TEdit controls.

      S:=TStringList.Create;
      FName:=ExtractFilePath(ParamStr(0))+'file.ini';
      IniF:=TIniFile.Create(FName);
      IniF.ReadSection('FILLERSETS',S);
      edAttach.Text:=S.Values['Attachments'];
      edPicsPath.Text:=S.Values['Images'];

When debugging, the FName is set properly to the correct full file path.
But when reading the section and its values, its always empty.

I tried the direct reading
IniF.ReadString('FILLERSETS','Attachments','') but still it didnt work.

Somehow, IniF is not created properly.

I am using Delphi 2007 for Win32 / Vista Business Edition

Any advice
Regards

Replies