Re: TInifile.ReadSection does not read values
- From: "Bob Richardson" <bobr at whidbey dot com>
- Date: Fri, 24 Mar 2006 07:35:01 -0800
"Shiva" <lunatic@xxxxxxxxxxx> wrote in message
news:e00ftl$eg4$1@xxxxxxxxxxxxxxxx
Hi,
I've got an inifile called jaeger2koptor.ini containing this data:
[Conversie]
FT1,13=422
PID,0=101
I want to store the strings "FT1,13=422" and "PID,0=101" in a TStringList.
I
used the following code to achieve this:
procedure TForm1.Button1Click(Sender: TObject);
const
inif = 'jaeger2koptor.ini';
var
Ini: TInifile;
ii: integer;
begin
if FileExists(inif) then begin
Ini := TInifile.Create(inif);
Ini.ReadSection('Conversie', memo1.Lines);
for ii := 0 to memo1.Lines.Count-1 do
showmessage(memo1.Lines[ii]);
end;
end;
For some reason, memo1.lines has not been filled after executing the line
"Ini.ReadSection('Conversie', memo1.Lines)" (I stepped through the code to
make sure it executed this command iow the inifile exists!). So why is
that?
I don't believe that Tinifile was designed to allow a comma within the key.
Perhaps you could edit the entire file and change all commas to another
character, e.g. ":" Of course that will only work if there are no commas to
the right of the equal sign.
.
- References:
- TInifile.ReadSection does not read values
- From: Shiva
- TInifile.ReadSection does not read values
- Prev by Date: Re: TInifile.ReadSection does not read values
- Next by Date: delphi2006... is quick rpt standard no longer available?!?
- Previous by thread: Re: TInifile.ReadSection does not read values
- Next by thread: Re: TInifile.ReadSection does not read values
- Index(es):