Sun Chili!Soft ASP Sun Chili!Soft
ASP Sun Microsystems

 

JScript Dictionary Object

The Dictionary object stores data key, item pairs.

Methods: JScript Dictionary Object

JScript Dictionary Object Add Method

Adds a key, item pair to a Dictionary object.

JScript Dictionary Object Exists Method

Returns a Boolean value indicating the existence of a key.

JScript Dictionary Object Items Method

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

JScript Dictionary Object Keys Method

Returns an array containing all the existing keys in a dictionary object.

JScript Dictionary Object Remove Method

Removes a key, item pair.

JScript Dictionary Object RemoveAll Method

Removes all key, item pairs.

Properties: JScript Dictionary Object

JScript Dictionary Object Key Property

A key in a Dictionary object.

JScript Dictionary Object Count Property

The number of items in a Dictionary object.

JScript Dictionary Object Item Property

An item associated with a key in a Dictionary object.

Syntax: JScript Dictionary Object

y = new ActiveXObject("Scripting.Dictionary")

Remarks: JScript Dictionary Object

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 an integer or a string, but can be anything except an array.

The following code illustrates how to create a Dictionary object:

var y = new ActiveXObject("Scripting.Dictionary");

y.add ("a", "test");

if (y.Exists("a"))

document.write("true");

...

Copyright 2002 Sun Microsystems, Inc. All rights reserved. Legal Notice.