0
这里是我的代码:有没有人知道什么“mscorlib:索引超出范围”意味着在我的VBScript代码?
dim myArrayList
function addName
Wscript.StdOut.WriteLine "What is your Quarterback's name?"
n = Wscript.StdIn.ReadLine
Wscript.StdOut.WriteLine "Attempts: "
a = Wscript.StdIn.ReadLine
Wscript.StdOut.WriteLine "Completions: "
c = Wscript.StdIn.ReadLine
Wscript.StdOut.WriteLine "Yards: "
y = Wscript.StdIn.ReadLine
Wscript.StdOut.WriteLine "Touchdowns: "
t = Wscript.StdIn.ReadLine
Wscript.StdOut.WriteLine "Interceptions: "
i = Wscript.StdIn.ReadLine
Set myArrayList = CreateObject("System.Collections.ArrayList")
myArrayList.Add n
myArrayList.Add a
myArrayList.Add c
myArrayList.Add y
myArrayList.Add t
myArrayList.Add i
end function
addname()
function show
for i = 1 to myArrayList.count
Wscript.StdOut.WriteLine myArrayList(i)
next
end function
show()
我收到一条错误, “mscorlib程序:索引超出范围必须为非负且必须小于集合参数名称的大小。:索引“
我不知道问题是什么 任何人都可以帮我解决这个问题吗?谢谢。
这是一个非常明确的答复。谢谢 –
不客气。 –