tags:

views:

26

answers:

1

How do I do something like this in ASP / VBScript?

Dim pairs
pairs= Dictionary(String, Integer)()
For Each item As String In storage
    Dim temp
    temp = item.Split(".")
    pairs.Add(temp(0), temp(1))
Next
A: 

Use the "Scripting.Dictionary" object like this:

set objPairs = Server.CreateObject("Scripting.Dictionary")
objPairs.add temp(0), temp(1)
Per Hornshøj-Schierbeck
Check out http://www.w3schools.com/asp/asp_ref_dictionary.asp
Per Hornshøj-Schierbeck
Avoid using this if you need to store the dictionary in the Session or Application object as it is not thread safe and will impact performance and scalability http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=129.
Andy Rose