Hi! FindClose und Resourcenschutzblöcke nicht vergessen
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var Ini: TInifile;
i : integer;
F: TSearchRec;
s, RootDir : string;
begin
i := 0;
RootDir := ExtractFilePath(ParamStr(0));
If FindFirst(RootDir + 'Stocks\*.ini', faAnyFile-faDirectory, F) = 0 then
Repeat
Ini:= TInifile.Create(RootDir + 'Stocks\'+F.Name);
try
inc(i);
s := Ini.ReadString('Stock','Name','');
Memo1.Lines.Add(IntToStr(i) +': ' + s);
finally
Ini.Free;
end;
Until FindNext(F) <> 0;
SysUtils.FindClose(F);
end;
Dani H.
At Least I Can Say I Tried