| To: | REALbasic NUG Italian <realbasic-nug dot it at lists dot realsoftware dot com> |
|---|---|
| Subject: | Re: Ripetizione di elementi in arrays |
| From: | "[sniper]" <sniper at darkworks dot it> |
| Date: | Sat, 6 May 2006 15:15:12 +0200 |
| Delivered-to: | realbasic-nug dot it at lists dot realsoftware dot com |
| Domainkey-signature: | a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:mime-version:in-reply-to:references:content-type:message-id:from:subject:date:to:x-mailer:sender; b=SK+BiT/k9A3x54skt0EF2zrod5ahTVevKmbL7a5kYLDUKhGM6zKyjjeI3+RQwrc/K43/dse3AmFu9yH9hnxWtYvOSuHh8vK/0oybbCwzYtS9XzboAQ+bYwW7cNX0glV6fJbTzRBSVEjb8UYhq37nc4qwFqjVI9PNb7pN3pu5UjE= |
| References: | <3B0909D1-B394-4BE3-A52B-9F82813F0AFC at ticino dot com> <44b48eef58e18d1d870a416fd604fd6e at libero dot it> <ac9b413d5faac6051302e3ee588c77f2 at libero dot it> <11B0E387-B7EE-4A8C-9D67-960961B11082 at ticino dot com> <C2B5DF69-4DAF-4B38-8F44-702C73BD1C17 at tiscali dot it> |
Usa questa funzione :
Function CountOccurrencies(entries() as String) As Dictionary
Dim occurrencies as New Dictionary
Dim entry as String
for each entry in entries
occurrencies.Value(entry) = occurrencies.Lookup(entry,0) + 1
next
Return occurrencies
End Function
Ti restituisce una tabella di hash contenente gli istogrammi che ti
servono.
Ti ricordo che puoi estrarre le chiavi (le tue stringhe in questo
caso) col metodo Keys() e
i valori (il numero delle presenze) col metodo Values(). Es. Dim chiavi() as String Dim conteggi() as Integer Dim d as Dictionary d = CountOccurrencies(vettore_delle_stringhe) chiavi = d.Keys() conteggi = d.Values() Saluti, Stefano Azzolini, Darkworks Software -- "When you ref use to give in with all your heart, only then do you transcend your humanity." -Alucard [sniper] - Darkworks Software CEO mail : sniper at darkworks dot it ICQ : 220236323 Skype : lord.sniper Darkworks Software http://www.darkworks.it/ mail : contacts at darkworks dot it |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: Ripetizione di elementi in arrays, Gualeni Giovanni |
|---|---|
| Next by Date: | Re: Ripetizione di elementi in arrays, Matteo Cortonesi |
| Previous by Thread: | Re: Ripetizione di elementi in arrays, Gualeni Giovanni |
| Next by Thread: | Re: Ripetizione di elementi in arrays, Matteo Cortonesi |
| Indexes: | [Date] [Thread] [Top] [All Lists] |