I am trying to create an array of dictionaries, since I need to create block of data divided by two like this :
<START Block_1>
<Name_1> <Value>
<Name_2> <Value>
<Name 3> <Value>
<END Block_1>
<START Block 2>
<Name 1> <Value>
<Name 2> <Value>
<Name 3> <Value>
<END Block_2>
I've already done all of the code to do this, the code is already creating the Lists with the values I need, but now I need to put this in an array, and this is where the problem begins.
I can do it, by doing it like this :
Dim myList : Set myList = CreateObject("Scripting.Dictionary")
myList.Add "Name1", "Value1"
myList.Add "Name2", "Value2"
Dim myArray : myArray = Array(myList)
MsgBox myArray(0).Item("Name1")
But then if I try to do it by creating an empty array and trying to fill it with the list I get an error. I am doing it like this :
Dim myList : Set myList = CreateObject("Scripting.Dictionary")
myList.Add "Name1", "Value1"
myList.Add "Name2", "Value2"
Dim myArray : myArray = Array()
ReDim Preserve myArray(1)
myArray(0) = myList
MsgBox myArray(0).Item("Name1")
And I get this error :
Wrong number of arguments or invalid property assignment
If I try to send a string in place of the list then I get the good result.
How can I solve this ?
Thank you in advance.