We can use the hashtable from .Net within QTP and list the keys and
values

Set myHash =
DotnetFactory.CreateInstance("System.Collections.Hashtable")
Set myEnumerator =
DotnetFactory.CreateInstance("System.Collections.IDictionaryEnumerator")

myHash.add  "a", "apple"
myHash.add "o", "orange"
myHash.add  "r","red"
myHash.add "b", "blue"

Set myEnumerator = myHash.getEnumerator

' using contains returns true or false
print "contains B " & myHash.Contains("B")
print "contains b " & myHash.Contains("b")
print "hash contains value red " & myHash.ContainsValue("red")
print "value for o = " & myHash.Item("o")
print "number of keys = " & myHash.count

While myEnumerator.movenext
        print "key " & myEnumerator.Key & ":: value " & myenumerator.value
Wend

Have fun playing with it.


Parke

-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

Reply via email to