Einzelnen Beitrag anzeigen

Benutzerbild von xZise
xZise

Registriert seit: 3. Mär 2006
Ort: Waldbronn
4.303 Beiträge
 
Delphi 2009 Professional
 
#1

Er ist fertig, aber der Fortschrittsbalken nicht?

  Alt 12. Mai 2006, 19:59
Ich habe einen INI Editor in dem ich überprüfe, ob doppelte Items/Sections vorkommen!

Um die Werte abzuspeichern habe ich Record genommen:
Delphi-Quellcode:
var Section : array of record
  Name : string; // Name der Section
  var Items : array of record
    Name : string; // Name des Items
    Value : string; // Wert des Items
  end;
end;
Nun überprüfe ich das folgendermaßen:
Delphi-Quellcode:
procedure TFCheck.BGoClick(Sender: TObject);
var
  i, j, k, Zeile : Integer;
begin
  {...}
  PBSearch.Max := High(UIni.FIni.Section);
  for i := 0 to High(UIni.FIni.Section) do
    PBSearch.Max := PBSearch.Max + High(UIni.FIni.Section[i].Items);

  // Sections werden überprüft
  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;
Der Balken ist nur nicht ganz "voll", aber er macht trotzdem mit dem Code weiter!
Dies viel mir mit der im Attachment liegenden Datei auf!

Wisst ihr, wo der Denkfehler liegt?
Angehängte Dateien
Dateityp: ini freggels_-_the_ini_208.ini (4,0 KB, 5x aufgerufen)
Fabian
Eigentlich hat MS Windows ab Vista den Hang zur Selbstzerstörung abgewöhnt – mkinzler
  Mit Zitat antworten Zitat