-- here's my take (similar to others)
-- it creates a proplist with
-- propnames = the occurance names
-- values = the counts
-- (email Lingo)

on cnt inList
  testList = inList.duplicate()
  testList.sort()

  outPList = [:]
  pCount = testList.count
  repeat with i = 1 to pCount
    pTarget = testList [i]
    outPList[string(pTarget)] = outPList[string(pTarget)] + 1
  end repeat
  put outPList
  return outPList
end

hth
-Buzz


At 3:09 PM -0300 6/30/05, you wrote:
Hi,

How is the best way to count the occurrences of values in a list? I have a
list with 6000+ random generated numbers and I need to count how many times
each of one appear.

Thank's in advance



Rodrigo Peres

[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email lingo-l@penworks.com (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
lingo-l@penworks.com  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to