Posted By

neal_grosskopf on 04/15/08


Tagged

array ASP


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

neal_grosskopf
asifrizvigmailcom


Reversing Arrays in ASP


 / Published in: ASP
 

URL: http://www.nealgrosskopf.com/tech/thread.asp?pid=10

ASP does not have a built in function to reverse or sort array like other languages. Find out how to do it.

  1. articlesRev = array( _
  2. "array item 0", _
  3. "array item 1", _
  4. "array item 2", _
  5. "array item 3" _
  6. )
  7.  
  8. Dim articles()
  9. ubnd = UBound(articlesRev)
  10. Redim articles(ubnd)
  11. for i = 0 to ubnd
  12. articles(ubnd - i) = articlesRev(i)
  13. next
  14.  
  15. for i=0 to ubound(articles)
  16. response.Write(articles(i)&"<br>")
  17. next

Report this snippet  

You need to login to post a comment.