ASP/VBScript Question - TechRepublic
General discussion
August 19, 2002 at 02:34 AM
galahad04

ASP/VBScript Question

by galahad04 . Updated 23 years, 10 months ago

I am using the Dictionary object to print out the contents of the Dictionary. However, I am not clear on what the difference is between Key and objDictionary.Item(Key) in the Response.Write line of the sample code below. I originally thought thatobjDictionary.Item(Key) and Key are the same thing, but they print different things, (objDictionary.Item(Key) prints the Dictionary item value, and Key prints the Dictionary item key. For example, Key prints out “Apple” whereas objDictionary.Item(Key) prints out “Red”.)

For Each Key In objDictionary

Response.Write “

Key = ” & Key & ” — Value = ” & objDictionary.Item(Key)

Next

This discussion is locked

All Comments