Bonjour,

Est-il possible d'ajouter un objet Collection dans un dictionnaire?

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
Dim dList As Dictionary
Dim cItems As Collection
 
' Initialize
Set dList = New Dictionary
Set cItems = New Collection
Set cItems2 = New Collection
 
' Add something to the collections
cItems.Add "Information 1"
cItems2.Add "Information 2"
 
' Add the collections to the dictionary
dList.Add "Key 1", cItems
dList.Add "Key 2", cItems2

Et si oui comment gère-t-on la libération mémoire à la destruction du dictionnaire ?