Posted By

elightbo on 11/03/06


Tagged

array multi-dimensional


Versions (?)

ASP initialize two-dimensional array


 / Published in: ASP
 

what a pain!!!

You can only resize the secomd dimension of an array once initialized.

Oh, and no sort function.

  1. <%
  2. Dim locations() 'declare array
  3.  
  4. ReDim locations(number, anotherNumber) 'resize array
  5.  
  6. 'In this example, we declare myarray() to have three 'dimensions and then resize the last element. When we resize 'the last element from 999 down to 9, we lose the data in the 'other 990 elements.
  7.  
  8. Dim myarray()
  9. ReDim myarray(20, 10, 99)
  10. ReDim Preserve myarray(20, 10, 999)
  11. ReDim Preserve myarray(20, 10, 9)
  12.  
  13. %>

Report this snippet  

You need to login to post a comment.