Manipulating Keys and Items in a Dictionary

Microsoft® Windows® 2000 Scripting Guide

By itself, a Dictionary is of little use; a Dictionary is valuable only when you can access, enumerate, and modify the keys and items within that Dictionary. After you have created a Dictionary, you will probably want to do such things as:

  • Determine how many key-item pairs are in that Dictionary.

  • Enumerate the keys and/or items within the Dictionary.

  • Determine whether or not a specific key exists in the Dictionary.

  • Modify the value of a key or an item in the Dictionary.

  • Remove key-item pairs from the Dictionary.

All of these tasks can be carried out by using the methods and properties provided by the Script Runtime library.