Dictionary Question

Results 1 to 3 of 3

Thread: Dictionary Question

  1. #1
    DictionaryRookie Guest

    Default Dictionary Question

    I am attempting to access each item in a Dictionary object that I have created<BR><BR>set strWord = server.CreateObject("scripting.dictionary")<BR>str Word.Add "word1", "manifesto"<BR>strWord.Add "word2", "dictionary"<BR><BR>for i = 1 to strWord.Count<BR><BR>Response.Write i.Item & "<BR>"<BR><BR>next<BR><BR>I keep getting errors on the resposne.write line. Is there anything similar to the VALUE attribute in the Dictionary object that will allow me to grab the value of each item and simply print it?<BR><BR>Thank you all!

  2. #2
    DictionaryRookie Guest

    Default RE: Dictionary Question

    fyi - there is a BR tag in the quotes that end the last line. Thanks

  3. #3
    Join Date
    Dec 1969

    Default Dictionary Answer

    &#060;%<BR>set strWord = server.CreateObject("scripting.dictionary")<BR>str Word.Add "word1", "manifesto"<BR>strWord.Add "word2", "dictionary"<BR>...<BR>For Each key In strWord<BR>&nbsp; &nbsp; Response.Write key & ": " & strWord(key) & "&lt;BR&#062;"<BR>Next<BR>...<BR>%&#062;<BR><BR>Bu t look at the Dictionary docs for a couple of other ways.<BR><BR>In fact, the docs on Dictionary.Keys demo almost what you are trying and fix your major bug in the process.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts