Easy Tutorial
❮ Prop Pics Asp Ref Error ❯

ASP Dictionary Object


The Dictionary object is used to store information in name/value pairs.


Try It Yourself - Examples

Is the specified key present?

Return an array of all items

Return an array of all keys

Return the value of an item

Set a key

Return the number of key/item pairs


Dictionary Object

The Dictionary object is used to store information in name/value pairs (equivalent to keys and items). The Dictionary object appears simpler than an array, yet it is a more satisfying solution for handling associative data.

Comparing Dictionaries and Arrays:

The following example creates a Dictionary object, adds some key/item pairs to the object, and then retrieves the value of the item with the key "gr":

Properties and methods of the Dictionary object are described below:

Properties

Property Description
CompareMode Sets or returns the comparison mode for comparing keys in the Dictionary object.
Count Returns the number of key/item pairs in the Dictionary object.
Item Sets or returns the value of an item in the Dictionary object.
Key Sets a new key value for an existing key in the Dictionary object.

Methods

Method Description
Add Adds a new key/item pair to the Dictionary object.
Exists Returns a Boolean value indicating whether the specified key exists in the Dictionary object.
Items Returns an array of all items in the Dictionary object.
Keys Returns an array of all keys in the Dictionary object.
Remove Removes the specified key/item pair from the Dictionary object.
RemoveAll Removes all key/item pairs from the Dictionary object.
❮ Prop Pics Asp Ref Error ❯