Home > DeveloperSection > Forums > find the length of array?
Somesh

Total Post:21

Points:147
Posted on    January-24-2011 1:58 AM

 VB Script VB Script 
Ratings:


 1 Reply(s)
 3762  View(s)
Rate this:
how i can find the length of Array in VB script?
Give the soln of its


Awadhendra Tiwari

Total Post:126

Points:882
Posted on    May-20-2011 8:12 AM

Hi.....

Use following code snippet to calculate length of array in vbscript

Dim NewArray(10)
NewArray(0) = "Apple"
MsgBox arrLength(NewArray)

Function arrLength(vArray)

ItemCount = 0

For ItemIndex = 0 To UBound(vArray)
If Not(vArray(ItemIndex)) = Empty Then
ItemCount = ItemCount + 1
End If
Next
arrLength
= ItemCount
End Function


Don't want to miss updates? Please click the below button!

Follow MindStick