Previous PageNext Page

8.6 Dictionary Object

The Dictionary object stores data as key, item pairs.
 

Methods

Add
 
Adds a key, item pair.
 
Exists
 
Indicates if a specified key exists.
 
Items
 
Returns an array containing all items in a Dictionary object.
 
Keys
 
Returns an array containing all keys in a Dictionary object.
 
Remove
 
Removes a key, item pair.
 
RemoveAll
 
Removes all key, item pairs.
 

Properties

CompareMode
 
The comparison mode for string keys.
 
Count
 
The number of items in a Dictionary object.
 
Item
 
An item for a key.
 
Key
 
A key
 

Syntax

Scripting.Dictionary

Remarks

A Dictionary object is the equivalent of a PERL associative array. Items, which can be any form of data, are stored in the array. Each item is associated with a unique key. The key is used to retrieve an individual item and is usually a integer or a string, but can be anything except an array.
 
The following code illustrates how to create a Dictionary object:
 

Dim d 'Create a variable

Set d = CreateObject("Scripting.Dictionary")

d.Add "a", "Athens" 'Add some keys and items

d.Add "b", "Belgrade"

d.Add "c", "Cairo"

...


Copyright © 2000 Chili!Soft

Previous PageTop Of PageNext Page