ASP array Array function instance

Source: Internet
Author: User

ASP array functions are used to create a static one-dimensional array. You cannot declare a dynamic array using array functionality.

Note that the first element in an array is always marked, such as zero,
MyArray (0).

The argument of the list is value and will become a list of elements of that array.

Declares a dynamic array using dim and ReDim statements. First, you use the Dim statement to declare a dynamic array that uses empty parentheses. Then, at the point after your program, you use the ReDim statement to declare the number of elements. In fact, you can re declare a dynamic array that you want to get many times.

Code:
<% myarray = Array ("A", "B", "C", www.111cn.net)%>
<% =myarray (0)%>
<% =myarray (1)%>
<% =myarray (2)%>
<% =myarray (3)%>
Output:
A B C D
Language (s): VBScript


Code:
<% myarray = Array (222, 333, 444, 555)%>
<% =myarray (0)%>
<% =myarray (1)%>
<% =myarray (2)%>
<% =myarray (3)%>
<% =myarray (4)%>
Output:
111 222 333 444 555
Language (s): VBScript

Code:
<%
Dim somearray ()
...
ReDim Somearray
...
ReDim somearray
%>
Language (s): VBScript
Code:
<% Dim Threedimensionarray (22, 14, 200)%
Language (s): VBScript

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.