Ich glaube ich weiss was Hawkeye meint:
Delphi-Quellcode:
PBSearch.Max := High(UIni.FIni.Section);
// HIER läufst du von 0 bis High
for i := 0 to High(UIni.FIni.Section) do
PBSearch.Max := PBSearch.Max + High(UIni.FIni.Section[i].Items);
// HIER nur von 0 bis High-1
// Damit fallen einige Items weg und der Wert von Position ist am Ende nicht hoch genug
for i := 0 to High(UIni.FIni.Section) - 1 do begin
PBSearch.Position := PBSearch.Position + 1;
for j := i + 1 to High(UIni.FIni.Section) do begin
if UIni.FIni.Section[i].Name = UIni.FIni.Section[j].Name then
LBErrors.Items.Add('Doppelte Section: ' + UIni.FIni.Section[i].Name + ' an Position: ' + IntToStr(i + 1) + ' & ' + IntToSTr(j + 1));
end;
for j := 0 to High(UIni.FIni.Section[i].Items) - 1 do begin
PBSearch.Position := PBSearch.Position + 1;
for k := j + 1 to High(UIni.FIni.Section[i].Items) do
if UIni.FIni.Section[i].Items[j].Name = UIni.FIni.Section[i].Items[k].Name then
LBErrors.Items.Add('Doppeltes Item: ' + UIni.FIni.Section[i].Items[j].Name + ' in Section ' + UIni.FIni.Section[i].Name + ' an Position: ' + IntToStr(j + 1) + ' & ' + IntToSTr(k + 1));
end;
Application.ProcessMessages;
end;
{...}
end;