VB Quicktakes - Dictionary Object

This simple example demonstrates the use of the Scripting libraries Dictionary object, which is very similiar and slightly more powerful than the Collection Object. To add this library to a visual basic project add a reference to the Microsoft Scripting Runtime.


Private Sub Test()
Dim dctExample As Dictionary

Set dctExample = New Dictionary
dctExample.Add "bone", "monkey"
MsgBox dctExample.Exists("bone") ' should return True

End Sub

About this page: