Hi Andries,
I can imagine something similar to this:
[CODE]
Procedure WordFound(AWord : String);
Var
I : Integer;
Begin
If StringList.Find(AWord, I) Then
StringList.Objects[I] := TObject(Succ(Integer(StringList.Objects[I])));
End;
[/CODE]
Greetz,
Peter.
-----Oorspronkelijk bericht-----
Van: [email protected] [mailto:[email protected]]namens
Andries Bos
Verzonden: zaterdag 3 oktober 2009 0:31
Aan: [email protected]
Onderwerp: Re: [delphi-en] counting occurances of unique words
Thanks Rory for your answer
I already found the TStringlist and the ability to add a second parameter
(an object), but i mis on how I could use this as a counter? ("Add to add a
new word, and Objects
(typecast as an Integer") to increment the count of a word that is already
in
the list.
)
A small sniplet of code could help maybe. It sounds like the easiest
solution.
I would expect max about 20 different wordt, but every one could occur about
5 times.
regards
Andries