The array Initialization is very simple. We use the new keyword to create an ArrayList object to assign values to the array item. The ArrayList has the Add method.
We can simply use it to get the size of the array: count
The method is good. 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 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 to make this array 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. What I demonstrate here 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.