dcsimg
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Aug 26, 1999

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Enumerate a Dictionary Object

Although the Dictionary object does not have an enumerator, it does have an Items method that returns a Variant array. You can use the For...Each construct on the array:

 
Dim vItem As Variant
Dim dict As Scripting.Dictionary

Set dict = New Scripting.Dictionary
dict.Add "Item1", "Item data 1"
dict.Add "Item2", "Item data 2"
dict.Add "Item3", "Item data 3"

For Each vItem In dict.Items
	Debug.Print vItem
Next

Set dict = Nothing

Before you can use the Dictionary object in your application, you must set a Project Reference to the Microsoft Scripting Runtime (scrrun.dll).

Steve Griffs
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date