' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
s = "817;9;516;11;817;408;9;817"
Set all = CreateObject("Scripting.Dictionary")
For Each n in Split(s,";")
    If all.Exists(n) Then
        all.Item(n) = all.Item(n) + 1
    Else
        all.Add n,1
    End If
Next
maxn = ""
maxval =  0
For Each n in all.Keys
    If all.Item(n) > maxval Then
        maxn = n
        maxval = all.Item(n)
    End If
Next
WScript.Echo maxn & " occurs " & maxval & " times"
Set all = Nothing
