This is an example of ASP using dictionary to create a two-dimensional array. The advantages of this method are:
1. the array subscript can be a string.
2. The length is not fixed.
<%
'================================================ ====
'Function: create a dynamic two-dimensional array and the array subscript can be a string.
'Author: wangsdong
'Site: http://www.aspprogram.cn
'The article is original to the author. Please indicate the source of the article and retain the author's information. Thank you for your support!
'================================================ ====
Set a1 = Createobject ("scripting. Dictionary ")
For I = 1 to 9
Set a2 = Createobject ("scripting. Dictionary ")
For j = 1 to 12
A2.add CSTR ("AAA" & J), CSTR ("B" & I & "B" & J * 10)
Next
A1.add ("BBB" & I), A2
Set a2 = nothing
Next
For I = 1 to 9
For j = 1 to 12
ACS = A1 ("BBB" & I) ("AAA" & J)
Response. Write ACS & "& nbsp ;"
Next
Response. Write "<br>"
Next
Response. End
Set a1 = nothing
%>