
Originally Posted by
YasserKhalil
If we only have one collection, say :
then the syntax to add data to the collection would be :
But if we have many collections with uniform structures, we can set array where each of its member is a collection.
It is like you have many variables vs you put them in single array like this :
- Many variables :
- Using array :
The same thing applied to collection, if you have many collections, your code would be like this :
- Many collections :
- Using array :

Originally Posted by
YasserKhalil
I have once answer your question about collection inside collection (nested).
Collection can store any kind of variables, arrays, and classes.
So you can :
If we want to access an array, we will call it through its index, for example :
So now we put it all together :
- to access the member of single collection, it would be :
- to access the member of arrayed collection, it would be :
- If the value stored in ".item" is an array, to access the member of this array would be :
where (0), (1), (2), etc, is index of the array, just like "arr = Array(1, 2, 3) --> Debug.print arr(1)"
- So to access the child collection of big the collection, the index to be used is 1 (because it is zero based index, created using "Array(strKey, New Collection)" syntax) :
- To add some data to this child collection, the syntax is :
Bookmarks