我在VBscript中使用dictonary。我有一些問題,我不明白的一些行爲:vbscript dictonary問題
Dim CmdData
Set CmdData = CreateObject("System.Dictonary")
CmdData.Add "11", "tttzz"
CmdData.Add "sssid", "KRN"
WScript.Echo(" ZZZZZZZZ= " & CmdData.Count) 'It prints zero and not 2
Dim s
s = CmdData.Item("11")
alert(s)
WScript.Echo(s) 'It prints empry box and not tttzz
Dim a, j
a = CmdData.Keys
For j = 0 To CmdData.Count -1
WScript.Echo(" ZZZZZZZZ= " & CmdData.Count)
WScript.Echo(a(j)) ' doesn not print
Next
If (CmdData.Exists("-ad")) Then
'WScript.Echo (" RR ") ' It prints it although not in the dictonary
End If
感謝
我從來沒有聽說過的' System.Dictonary組件。這是一個自定義組件嗎?通常,'Scripting.Dictionary'是人們使用VBScript的東西。 –