Version: 2.0
The Items method is used to retreive all of the items in a particular Dictionary object and store them in an array.
We can then iterate through the items using a For....Next loop.
<%
dim guitars, arrayItems, i
set guitars=CreateObject("Scripting.Dictionary")
guitars.Add "e", "Epiphone"
guitars.Add "f", "Fender"
guitars.Add "g", "Gibson"
guitars.Add "h", "Harmony"
arrayItems = guitars.Items
for i = 0 to guitars.Count -1
Response.Write "<br>" arrayItems(i)
next
%>
"Epiphone"
"Fender"
"Gibson"
"Harmony"
This code demonstrates using the Dictionary object's Count property to determine the amount of key/item pairs.