Monday, October 10, 2011

Dictionary Object


Scripts often retrieve information from an outside source, such as a text file or a Database. After this information has been retrieved, it needs to be stored in Memory so that the script can act upon it. Information such as this can be stored Dictionary object.

The Dictionary object functions stores values in key-item pairs. The Dictionary object is similar to a Collection object .Like an array or a Collection object, Dictionary object holds elements, called items or members, containing data. A Dictionary object can contain any data whatsoever, including objects and other Dictionary objects. Access the value of these dictionary items by using unique keys (or named values) that are stored along with the data. Dictionary is a COM object.
Creating Dictionary
Set oDictionary = CreateObject("Scripting.Dictionary")
Adding Key-Item Pairs to a Dictionary
Set oDictionary = CreateObject("Scripting.Dictionary")
oDictionary.Add "Fax", "Faxing"
Here the Key is Fax and Key Value is Faxing

No comments:

Post a Comment