Friday, August 20, 2010

Dictionary Objects

    Dim a, d, i , j, s()  ' Create some variables.
    Set d = CreateObject("Scripting.Dictionary")
    d.Add "B", "Baba"   ' Add some keys and items.
    d.Add "A", "Fakruddin"
    d.Add "D", "Dudekula"
    a = d.Keys   ' Get the keys.

    For i = 0 To d.Count -1 ' Iterate the array.
        redim preserve s(i)
        s(i)=a(i)
    Next

    For j= 0 to ubound(s)
        print j & Chr(32) & " Key is "& Chr(32) & a(j)
        print a(j) & Chr(32) & " Item is "& Chr(32) & d.Item(a(j))
    Next

No comments:

There was an error in this gadget