Dictionaries are a great way collect up lists of items, especially if you don't know how many items you will need to have in your list.
You can think of a dictionary exactly like a classic dictionary, there are two pieces of information. In the classic dictionary there is a word and then the definition. In the dictionary object, there is a key and an item. The key is the word, and the item is the definition.
If you use the "Add" method and you get an error code 457, it means that the key already exists. If there is a chance that you will be trying to add a key that might exist. If you list will have duplicates or you are not sure, you should check to see if the item exists before trying to add the item. See the example below on processing schematics to see how that was done.
- You will need to add the Microsoft Scripting Runtime reference. Scripting How-To: Using the Microsoft Scripting Runtime library with AWR Scripting