Page

B.1.0- The Scripting.Dictionary Object

Created by Brendan Doss.
Last Updated by Brendan Doss.  

PublicCategorized as Appendix B.

Not yet tagged
<< B.0.0- The Scripting Run-Time Library ObjectsAppendixBB.2.0- The Scripting.FileSystemObject Object >>

The Scripting.Dictionary Object

The Dictionary object provides a useful storage object that we can use to store values accessed and referenced by their name, rather than by index as would be the case in a normal array. The properties and methods exposed by the Dictionary object are:

 

Property

Description

CompareMode

(VBScript only). Sets or returns the string comparison mode for the keys.

Count

Read-only. Returns the number of key/item pairs in the Dictionary.

Item(key)

Sets or returns the value of the item for the specified key.

Key(key)

Sets or returns the value of a key.

 

Method

Description

Add(key, item)

Adds the key/item pair to the Dictionary.

Exists(key)

Returns True if the specified key exists or False if not.

Items()

Returns an array containing all the items in a Dictionary object.

Keys()

Returns an array containing all the keys in a Dictionary object.

Remove(key)

Removes a single key/item pair specified by key.

RemoveAll()

Removes all the key/item pairs.

* An error will occur if we try to add a key/item pair when that key already exists, remove a key/item pair that doesn't exist, or change the CompareMode of a Dictionary object that already contains data.

<< B.0.0- The Scripting Run-Time Library ObjectsAppendixBB.2.0- The Scripting.FileSystemObject Object >>

Copyright © 2003 by Wiley Publishing, Inc.

Powered by Near-TimeTerms of Services | Privacy Policy | Security Policy |