0
如果我成立了一個字典作爲這樣的:如何附加到字典中的鍵值的數組?
set myDict = CreateObject("Scripting.Dictionary")
我問一個用戶他的名字。
Wscript.StdOut.WriteLine "What is your name: "
name = Wscript.StdIn.ReadLine
然後我問用戶五個數字。
Wscript.StdOut.WriteLine "Enter a number: "
num1 = cint(Wscript.StdIn.ReadLine)
Wscript.StdOut.WriteLine "Enter a number: "
num2 = cint(Wscript.StdIn.ReadLine)
Wscript.StdOut.WriteLine "Enter a number: "
num3 = cint(Wscript.StdIn.ReadLine)
Wscript.StdOut.WriteLine "Enter a number: "
num4 = cint(Wscript.StdIn.ReadLine)
Wscript.StdOut.WriteLine "Enter a number: "
num5 = cint(Wscript.StdIn.ReadLine)
,並把五個提示號碼到任何陣列使用的ArrayList
Set myArrayList = CreateObject("System.Collections.ArrayList")
myArrayList.Add num1
myArrayList.Add num2
myArrayList.Add num3
myArrayList.Add num4
myArrayList.Add num5
如果我在我所建立的字典添加一個鍵與name
。
myDict.Add name
我可以添加myArrayList
在我以前成立myDict
字典中的值name
。
如果是這樣,如果我要循環五個數字問題,如何追加或添加到myArrayList
?