Dynamic Arrays
Dynamic arrays come in handy when you aren’t sure how many items your array will hold. To create a dynamic array you should use the Dim statement along with the array’s name, without specifying upper bound:
<% Dim arrCars arrCars = Array() %>
In order to use this array you need to use the ReDim statement to define the array’s upper bound:
<% Dim arrCars arrCars = Array() Redim arrCars(27) %>
If in future you need to resize this array you should use the Redim statement again. Be very careful with the ReDim statement. When you use the ReDim statement you lose all elements of the array. Using the keyword PRESERVE in conjunction with the ReDim statement will keep the array we already have and increase the size:
<% Dim arrCars arrCars = Array() Redim arrCars(27) Redim PRESERVE arrCars(52) %>
