What is the best way to iterate through an array in Classic Asp VBScript?

Question :

What is the best way to iterate through an array in Classic Asp VBScript?,

Answer :

In the code below

For i = LBound(arr) To UBound(arr)  

What is the point in asking using LBound? Surely that is always 0.

,

Why not use For Each? That way you don’t need to care what the LBound and UBound are.

Dim x, y, z  x = Array(1, 2, 3)    For Each y In x      z = DoSomethingWith(y)  Next  

That’s the answer What is the best way to iterate through an array in Classic Asp VBScript?, Hope this helps those looking for an answer. Then we suggest to do a search for the next question and find the answer only on our site.

Read More  How do I prevent IIS7 from dropping my cookies?

Disclaimer :

The answers provided above are only to be used to guide the learning process. The questions above are open-ended questions, meaning that many answers are not fixed as above. I hope this article can be useful, Thank you