我想将二维数组转换为asp中的一维数组。这可能吗? 如果那么请给我一个例子。
答案 0 :(得分:1)
这是一个可以为你完成的功能:
Function TransformToSingleArray(TwoDimArray)
TotalValues = (uBound(TwoDimArray,1) +1) * (uBound(TwoDimArray,2) +1)
ReDim OneDimArray(TotalValues)
ArrCnt = 0
For x = lBound(TwoDimArray,1) to uBound(TwoDimArray,1)
For y = lBound(TwoDimArray,2) to uBound(TwoDimArray,2)
EachValue = TwoDimArray(x,y)
OneDimArray(ArrCnt) = EachValue
ArrCnt = ArrCnt + 1
Next
Next
TransformToSingleArray = OneDimArray
End Function