views:

126

answers:

1

I need to create multi-dimensional array of strings. Each row of the array can have varying number of strings. Something like the follwing code:

twoDimension = Array(Array())  
ReDim Preserve twoDimension(3)  
For i = 0 to 2  
 If i = 1 Then  
  twoDimension(i) = Array(1,2,3)  
 End If  
 If i = 2Then  
     twoDimension(i) = Array(1,2,3,4,5)  
   End If  
Next  
+2  A: 

How about a dictionary

Set a = CreateObject("Scripting.Dictionary")
a.Add 0, Array(1,2,3)
a.Add 1, Array(4,5,6)
MsgBox a.Count
MsgBox a.Item(0)(2)
MsgBox a.Item(1)(1)
Tester101