Einzelnen Beitrag anzeigen

PredatorMask

Registriert seit: 9. Aug 2007
10 Beiträge
 
Delphi 7 Enterprise
 
#26

AW: TStringList, Pos, PosEx usw.311

  Alt 9. Jun 2011, 08:19
hey jungs, letzter vorschlag funktioniert!

nur könntet ihr mir sagen, warum die gauge (sowie eine progressbar) ums verrecken nicht macht, was sie machen soll ?

Delphi-Quellcode:
  function IsSameText(const str1, str2: string): Boolean;
  begin
    Result := AnsiStrIComp(PChar(str1), PChar(Str2)) = 0;
  end;

var
  load: TStringlist;
  i: integer;
  RE : TRichEdit;
begin
  RE := nil;
  load := TStringlist.Create;
  gauge1.Progress := 0;
  gauge1.MaxValue := load.Count;
  label2.caption := 'work in progress ... please wait';
  try
    load.LoadFromFile('C:\1.txt');
    for i := 0 to load.count - 1 do
      begin
        gauge1.Progress := i;
        application.ProcessMessages;
        if IsSameText('hallo eins:', load[i]) then
          RE := RichEdit1
        else if IsSameText('hallo zwei:', load[i]) then
          RE := RichEdit2;
        if Assigned(RE) then
          RE.Lines.Add(load[i]);
          application.ProcessMessages;
          label1.caption := inttostr(i) + ' / ' + inttostr(load.count) + ' lines done';
      end;
  finally
    load.Free;
    label2.caption := 'waiting ...';
  end;
der "counter" funktioniert, aber die gauge nicht ... total bescheuert
Mit freundlichen Grüßen,
Nino
  Mit Zitat antworten Zitat