Micro Focus QTP (UFT) Forums
dictionary objects - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: dictionary objects (/Thread-dictionary-objects)



dictionary objects - mrajeshtnl - 02-07-2012

what is the use of dictionary objects and how can we use them, can any one explain with an example?
Thanks


RE: dictionary objects - rajpes - 02-07-2012

As an alternative to using environment variables to share values between
actions as described above, you can use the Dictionary object. The
Dictionary object enables you to assign values to variables that are accessible from all actions .

Set d = CreateObject("Scripting.Dictionary")
d.Add "a", "Athens" ' Add some keys and items.
d.Add "b", "Belgrade"
d.Add "c", "Cairo"

msgbox d("a")


RE: dictionary objects - ravi.gajul - 02-07-2012

A Dictionary object is the equivalent of a PERL associative array. Items can be any form of data, and are stored in the array. Each item is associated with a unique key. The key is used to retrieve an individual item and is usually a integer or a string, can be an object as well.

Methods that can be performed:
1.items
2.exists
3.keys
4.Remove
5.Remove all
6.Add

Properties:
1.Count
2.Item
3.Key


RE: dictionary objects - mrajeshtnl - 02-07-2012

Thank you,