01-24-2014, 07:48 PM
How to write a vb script for reverse of an array(reversing an array)?
|
vb script for reverse of an array?
|
|
01-24-2014, 07:48 PM
How to write a vb script for reverse of an array(reversing an array)?
01-26-2014, 01:35 PM
below is the snippet which will give you the basic idea.
Code: a = Array("a","b","c")
i = 0
For x = ubound(a) to 0 Step-1
ReDim preserve b(i)
b(i) = a(x)
i= i+1
Next
msgbox "your array items" & join(a)
msgbox "Reservese items" &join(b)
Thanks,
SUpputuri
01-27-2014, 03:49 PM
Hi,
Here is one more method: Code: Sub Reverse( ByRef myArray )
Dim i, ArrCount , HalfArrCount , strHolder
ArrCount = UBound(a)
HalfArrCount = Int(ArrCount/2)
For i = 0 to HalfArrCount Step 1
strHolder= a(i)
a(i) = a(ArrCount-1)
a(ArrCount-1) = strHolder
Next
End SubTry this... |
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads… | |||||
| Thread | Author | Replies | Views | Last Post | |
| How to convert a single dimension array to two dimensional array | venkatesh9032 | 3 | 6,430 |
02-10-2014, 03:07 PM Last Post: pranikgarg |
|
| Adding array to another Global array in VB Script | test911 | 1 | 3,577 |
12-02-2012, 12:40 PM Last Post: parminderdhiman84 |
|