ASP uses dictionary to create a two-dimensional array

Source: Internet
Author: User
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
%>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.