Re: TInifile.ReadSection does not read values
- From: "Shiva" <lunatic@xxxxxxxxxxx>
- Date: Fri, 24 Mar 2006 13:11:02 +0100
Thanks, I found out that TInifile.ReadSection calls the WinAPI
GetPrivateProfileString(). This API has a parameter called FFilename filled
with 'jaeger2koptor.ini'. This wasn't enough: I had to specify the entire
path to make sure that GetPrivateProfileString() would return 'true'.
So after I changing the constant 'inif' to
"V:\SectorApplicaties\Personen\Jaeger2Koptor\jaeger2koptor.ini", the program
did run correctly This is what the program looks right now:
const
inif = 'V:\SectorApplicaties\Onderwerpen\Jaeger2Koptor\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;
"Maarten Wiltink" <maarten@xxxxxxxxxxxxxxxxxx> wrote in message
news:4423c959$0$11075$e4fe514c@xxxxxxxxxxxxxxxxx
"Shiva" <lunatic@xxxxxxxxxxx> wrote in message
news:e00ftl$eg4$1@xxxxxxxxxxxxxxxx
[...]
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?
That, I don't know. But you could try compiling with debug DCUs and
stepping through ReadSection. It's fairly small, mainly some clerical
wrapping around a WinAPI function that may or may not do exactly what
you expect. MSDN can tell you what it does.
Groetjes,
Maarten Wiltink
.
- Follow-Ups:
- Re: TInifile.ReadSection does not read values
- From: alanglloyd@xxxxxxx
- Re: TInifile.ReadSection does not read values
- From: J French
- Re: TInifile.ReadSection does not read values
- References:
- TInifile.ReadSection does not read values
- From: Shiva
- Re: TInifile.ReadSection does not read values
- From: Maarten Wiltink
- TInifile.ReadSection does not read values
- Prev by Date: Re: Left-Handed TreeView
- Next by Date: Re: TInifile.ReadSection does not read values
- Previous by thread: Re: TInifile.ReadSection does not read values
- Next by thread: Re: TInifile.ReadSection does not read values
- Index(es):