1. Зачем на каждый параметр заводить секцию, если они имеют разные имена?
2. У TIniFile есть специальные методы, которые позволяют считать список секций и список ключей в конкретной секции.
Код:
uses
IniFiles;
procedure TForm1.Button1Click(Sender: TObject);
var
IniFile : TIniFile;
Sections, Keys : TStringList;
I, J, V : Integer;
begin
Sections := TStringList.Create;
Keys := TStringList.Create;
IniFile := TIniFile.Create('');
IniFile.ReadSections(Sections);
For I := 0 To Sections.Count-1 Do
Begin
IniFile.ReadSection(Sections[i],Keys);
For J := 0 To Keys.Count-1 Do
Begin
V := IniFile.ReadInteger(Sections[i],Keys[J],0);
ShowMessage(Format('Section ''%s'', %s=%d',[Sections[i],Keys[J],V]));
End;
End;
Keys.Free;
Sections.Free;
end;