Post this Blog to facebook Add this Blog to del.icio.us! Digg this Blog furl this Blog Add this Blog to Reddit Add this Blog to Technorati Add this Blog to Newsvine Add this Blog to Windows Live Add this Blog to Yahoo Add this Blog to StumbleUpon Add this Blog to BlinkLists Add this Blog to Spurl Add this Blog to Google Add this Blog to Ask Add this Blog to Squidoo

Sep 17, 2009

VBScript and Multiple Arrays

There is no direct way to work out how many arrays there are in a VBScript multidimension array, however a simple VBScript function will do the job:

Function dimensions (inarray)

On Error Resume Next

Dim dims: dims = 0

Dim dim_check

Dim i: For i = 1 to 32

dim_check = ubound(inarray, i)

If Err.Number = 0 Then

dims = dims + 1

End If

Next

dimensions = dims

End Function

There's more on VBScript multidimensional arrays in Using Multidimensional Arrays with VBScript: How to Work with More than One Dimension in VBScript Programming.