用ASP也有二维数组,而且也很简单好用,这里为了介绍asp二维数组的使用,定义了一个函数,用来生成形如“00^a1^b1^c1^d1|11^a2^b2^c2^d2|22^a3^b3^c3^d3|33^a4^b4^c4^d4”的二维数组
1、函数的定义
Function CreateArr(str)
dim arr()
str=split(str,"|")
for i=0 to UBound(str)
arrstr=split(str(i),"^")
for j=0 to Ubound(arrstr)
ReDim Preserve arr(UBound(str),UBound(arrstr))
arr(i,j)=arrstr(j)
next
next
CreateArr=arr
End Function
2、函数的使用
SUMARRY = "00^a1^b1^c1^d1|11^a2^b2^c2^d2|22^a3^b3^c3^d3|33^a4^b4^c4^d4"
arr = CreateArr(SUMARRY)
for i = 0 to 3
for j = 0 to 4
response.write arr(i,j)&" "
next
response.write "<br>"
next
3、运行的结果
00 a1 b1 c1 d1
11 a2 b2 c2 d2
22 a3 b3 c3 d3
33 a4 b4 c4 d4