我是vbscript的新手,所以请不要严格要求我。
我有这个
Dim positionArray
positionArray = array()
set qwe = server.createobject("Scripting.Dictionary")
set parentListSorted= server.createobject("Scripting.Dictionary")
qwe = BuildClassificators(parentList,crntArtclId,parentListSorted,sum,positionArray)
Function BuildClassificators(parentList,curArtclId,parentListSorted,summary,posArray)
Dim i,currentArtclId,items,keys
items = parentList.Items
keys = parentList.Keys
for i = 0 to parentList.Count - 1
if (items(i) = curArtclId) then
ReDim Preserve posArray(Ubound(posArray) + 1)
posArray(Ubound(posArray)) = items(i)
currentArtclId = keys(i)
parentListSorted.Add currentArtclId,items(i)
parentList.Remove currentArtclId
summary = summary + 1
parentListSorted = BuildClassificators(parentList,currentArtclId,parentListSorted,summary,posArray)
else
summary = 0
end if
if (i = parentList.Count - 1 And summary = 0) then
parentListSorted = BuildClassificators(parentList,posArray(Ubound(posArray)),parentListSorted,summary,posArray)
end if
next
BuildClassificators = parentListSorted
End Function
第一个问题,当我使用ReDim Preserve posArray(Ubound(posArray)+ 1)第三次我的程序中断时(例如第一次和第二次需要时它工作)。程序刚从函数中出来。什么可能是? 如果我返回函数值rigth,任何人都可以回答吗? 谢谢你的帮助。