Hi all
Long story so I'll try and keep it to the relevant bit.
I have code that links with the API of a mainstream program. My code iterates thousands of items from the mainstream program and returns the type categorisation of the file, e.g. pictures, documents, text, programs. Currently, for each item it examines, I am storing the type category in a stringlist, so the finished list might look like this :
documents
text
text
programs
text
pictures
programs
documents
documents
pictures
programs
pictures
documents
....
and so on, hundreds or thousands of times.
What I need to do next is count all the occurances of each type (but there are hundreds of actual types, not just those I have listed above, so I cant create a simple text lookup from a known, hardcoed, list. My code need to work out how many times each category is mentioned.
So it needs to read the list and count each time a value appears
Example :
Documents : 4
Text : 3
Programs : 3
Pictures : 3
How might I achieve this? Please?