Powerful Array Function (called by asp + program Array Function)

Source: Internet
Author: User

Http://www.asp888.net bean curd technology station

Powerful Array Function (called by asp + program Array Function)
Array initialization: we use the new keyword to create an ArrayList object.
Assign a value to the item of the array. We only need to use the ArrayList method to Add the item.
Get the array size: count Method
Let's take a look at the example below.
<%
Dim arr as new ArrayList
Arr. Add (1)
Arr. Add (3)
Arr. add (2)
Arr. add (445)
Arr. add (223)
Arr. add (112)
Response. write (cStr (arr. count ))
%>
The returned value of this program is 6.
If we want him to display all the data, we should
<%
For I = 0 to Arr. count-1
Response. write (arr. item (I ))
Next
%>
After executing this program, we will find that the data is not sorted and displayed. We can call the sort method
This array is a sorted array.
<%
Arr. sort ()
For I = 0 to Arr. count-1
Response. write (arr. item (I ))
Next
%>
Through these examples, we have found that in asp.net, we have a powerful array processing object.
The demonstration is only the tip of the iceberg about the powerful functions of this object. You can get more surprises by viewing the help of Vs7 beta1.


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.