Set oDic = CreateObject("Scripting.Dictionary")
oDic.Add "String", "Test"
oDic.Add "Bool", True
oDic.Add "Int", 1
arrTest = Array("1", "2")
oDic.Add "Array", arrTest
Set oTemp = CreateObject("Scripting.Dictionary")
oTemp.Add "First", "One"
oTemp.Add "Second", "Two"
oDic.Add "Dictionary", oTemp
Set oTemp = Nothing
ShowDic oDic, "oDic"
Sub ShowDic(oD, strName)
For Each strKey In oD.Keys()
Select Case TypeName(oD.Item(strKey))
Case "Integer"
WScript.Echo strName & "(" & strKey & ") => " & oD.Item(strKey)
Case "String"
WScript.Echo strName & "(" & strKey & ") => " & oD.Item(strKey)
Case "Boolean"
WScript.Echo strName & "(" & strKey & ") => " & oD.Item(strKey)
Case "Variant()"
ShowArray oD.Item(strKey), strKey
Case "Dictionary"
ShowDic od.Item(strKey), strKey
Case Else
WScript.Echo "UNKNOWN TYPE: " & TypeName(od.Item(strKey)) & " " & strName & "(" & strKey & ") => " & oD.Item(strKey)
End Select
Next
End Sub
Sub ShowArray(oA, strName)
For i = 0 To UBound(oA)
Select Case TypeName(oA(i))
Case "Integer"
WScript.Echo strName & "(" & i & ") => " & oA(i)
Case "String"
WScript.Echo strName & "(" & i & ") => " & oA(i)
Case "Boolean"
WScript.Echo strName & "(" & i & ") => " & oA(i)
Case "Variant()"
ShowArray oA(i), strName & "(" & i & ")"
Case "Dictionary"
ShowDic oA(i), strName & "(" & i & ")"
Case Else
WScript.Echo "UNKNOWN TYPE: " & TypeName(od.Item(strKey)) & " " & strName & "(" & strKey & ") => " & oD.Item(strKey)
End Select
Next
End Sub