Login | Register   
RSS Feed
Download our iPhone app
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



Application Security Testing: An Integral Part of DevOps

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

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.



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