Dim array1()
Dim array2()

ReDim array1(50,17)
'ReDim preserve array1(40,17)  'cannot ReDim and change first dimension of a 2D array!
ReDim array2(3)

wscript.echo  "ubound of 1D array1 = " & ubound(array1)	'returns 3
wscript.echo  "ubound of 2D array1 = " & ubound(array1,2)	'returns 2, the ubound of the 2nd dimension

wscript.echo  "ubound of 1D array2 = " & ubound(array2)
array2(1) = split("goodbye nothing"," ",-1,1) 'this creates a "ragged" array
array2(3) = split("hello world"," ",-1,1) 'this creates a "ragged" array
wscript.echo  "array2(3)(0) = " & array2(3)(0) 'hello
wscript.echo  "array2(3)(1) = " & array2(3)(1) 'world
wscript.echo  "ubound of ragged array2(3) = " & ubound(array2(3)) ' returns 1, the ubound of the array contained within array2(3)
wscript.echo  "array2(1)(0) = " & array2(1)(0) 'goodbye
wscript.echo  "array2(1)(1) = " & array2(1)(1) 'nothing

wscript.echo  "ubound of array2(3) = " & ubound(array2(3),1)	'returns 1, the ubound of the array contained within array2(3)

ReDim Preserve array2(1) 'you CAN ReDim and change the first dimension of a sparse/ragged array!
wscript.echo  "array2(1)(0) = " & array2(1)(0) 'goodbye
wscript.echo  "array2(1)(1) = " & array2(1)(1) 'nothing

