Dictionary.Add Method (VB6) |
Yes
dictionaryobject.Add key, item
dictionaryobject
Use: Required
Data Type: Dictionary object
A reference to a Dictionary object.
key
Use: Required
Data Type: String
A key value that's unique in the Dictionary object.
item
Use: Required
Data Type: Object
The item to be added to the dictionary.
Adds a key and its associated item to the specified Dictionary object.
If the key isn't unique, runtime error 457, "This key is already associated with an element of this collection," is generated.
item can be of any data type, including objects and other Dictionary objects.
Set oDict = New Dictionary iVal = 1 Set oTest = New clsTest With oTest .Age = 10 .Phone = "0112 31234" .TestName = "Russell" End With oDict.Add CStr(iVal), oTest Set oTest = Nothing
3.17.179.247