Einzelnen Beitrag anzeigen

Basilikum

Registriert seit: 9. Aug 2003
389 Beiträge
 
Delphi 7 Professional
 
#8

Re: Worthäufigkeit bestimmen

  Alt 24. Feb 2004, 09:30
Zitat von Pseudemys Nelsoni:
Delphi-Quellcode:
...
      IsInArray := false;
      TempWord := Copy(TempStr, 1, Pos(sep, TempStr)-1);
      Delete(TempStr, 1, Pos(sep, TempStr));
      for i := low(WordCount) to high(WordCount) do
      begin
        if WordCount[i].word = TempWord then
        begin
          IsInArray := true;
          inc(WordCount[i].count);
        end;
      end;
      if not IsInArray then
      SetLength(WordCount, Length(WordCount)+1);
      WordCount[high(WordCount)].word := TempWord;
      WordCount[high(WordCount)].count := 1;
    end;
  end;
...
ich vermute mal, dass hier ein Begin/End vergessen ging:

Delphi-Quellcode:
  if not IsInArray then Begin
    SetLength(WordCount, Length(WordCount)+1);
    WordCount[high(WordCount)].word := TempWord;
    WordCount[high(WordCount)].count := 1;
  end;
  Mit Zitat antworten Zitat