August 1999
Intermediate to advanced
1488 pages
72h 53m
English
dictionaryobj.Items()
The Items() method of the Dictionary object returns all the items in the dictionary in an array.
Listing 9.20 uses Items() method to retrieve all the items that are in the dictionary.
<html>
<script language="JScript">
<!-- Hide
//Create dictionary
var fruits = new ActiveXObject("Scripting.Dictionary");
//define elements of dictionary
fruits.Add("A","apple");
fruits.Add("B","berry");
fruits.Add("G","grape");
fruits.Add("O","orange"); //Create an array theArray = (new VBArray(fruits.Items())).toArray(); document.write("The array contains:<br>"); //Display items in array for (i in theArray) { document.write("theArray[",i,"]=",theArray[i],"<br>"); ... |
Read now
Unlock full access