What is a Dictionary Object and know other associated methods to it.
Vote if this topic was useful to you
What is a Dictionary Object and know other associated methods to it.
Dictionary Object:
Object that stores data key, item pairs. Items can be any form of data. 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
Ex:
Dim d ' Create a variable.
Set d = CreateObject("Scripting.Dictionary")
d.Add "a", "Athens" ' Add some keys and items.
d.Add "b", "Belgradeā
d.Add "c", "Cairo"
Methods:
Add Method : Adds a key and item pair to a Dictionary object
Syntax:object.Add (Key,Item)
Exists: Returns true if a specified key exists in the Dictionary object, false if it does not.
Syntax: object.Exists(Key)
Items: Returns an array containing all existing Items in a Dictionary object.
Syntax: arrItems = object.Items()
Keys: Returns an array containing all existing keys in a Dictionary object.
Syntax: arrKeys = object.Keys()
Remove: Removes a key, item pair from a Dictionary object.
Syntax: object.Remove(key)
RemoveAll: The RemoveAll method removes all key, item pairs from a Dictionary object.
Syntax: object.RemoveAll()
Propeties:
Count: Returns the number of items in a collection or Dictionary object.
Syntax: object.Count
Item: Sets or returns an item for a specified key in a Dictionary object. For collections,
returns an item based on the specified key.
Syntax:object.Item(Key)
Key: Sets a key in a Dictionary object.
Syntax: object.Key(key) = newkey
Object that stores data key, item pairs. Items can be any form of data. 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
Ex:
Dim d ' Create a variable.
Set d = CreateObject("Scripting.Dictionary")
d.Add "a", "Athens" ' Add some keys and items.
d.Add "b", "Belgradeā
d.Add "c", "Cairo"
Methods:
Add Method : Adds a key and item pair to a Dictionary object
Syntax:object.Add (Key,Item)
Exists: Returns true if a specified key exists in the Dictionary object, false if it does not.
Syntax: object.Exists(Key)
Items: Returns an array containing all existing Items in a Dictionary object.
Syntax: arrItems = object.Items()
Keys: Returns an array containing all existing keys in a Dictionary object.
Syntax: arrKeys = object.Keys()
Remove: Removes a key, item pair from a Dictionary object.
Syntax: object.Remove(key)
RemoveAll: The RemoveAll method removes all key, item pairs from a Dictionary object.
Syntax: object.RemoveAll()
Propeties:
Count: Returns the number of items in a collection or Dictionary object.
Syntax: object.Count
Item: Sets or returns an item for a specified key in a Dictionary object. For collections,
returns an item based on the specified key.
Syntax:object.Item(Key)
Key: Sets a key in a Dictionary object.
Syntax: object.Key(key) = newkey
Similar topics
» When UFT Does Not Identify an Object
» QTP recognizes or identifies Web Page as ActiveX object
» Using a RegExp object, how to find the match of all occurrences of a search string pattern inside a target string.
» QTP recognizes or identifies Web Page as ActiveX object
» Using a RegExp object, how to find the match of all occurrences of a search string pattern inside a target string.
Permissions in this forum:
You cannot reply to topics in this forum
Thu Jun 19, 2014 11:31 am by thomasdfg
» How to identify the object when it is dynamically changing behavior
Wed Jun 18, 2014 6:37 pm by thomasdfg
» Patches for QTP 10, 11, 11.5
Wed Jun 18, 2014 6:04 pm by thomasdfg
» Retrieving data from Txt file into datatable
Wed Jun 18, 2014 5:32 pm by thomasdfg
» VB Script to count number of links in a web page.
Wed Jun 18, 2014 4:51 pm by thomasdfg
» Customized HTML reports in QTP
Wed Jun 18, 2014 4:42 pm by thomasdfg
» how to print values into a field of a web page, from a data table in qtp?
Wed Jun 18, 2014 4:37 pm by thomasdfg
» How to delete cookies using QTP?
Wed Jun 18, 2014 4:30 pm by thomasdfg
» When UFT Does Not Identify an Object
Wed Jun 18, 2014 4:23 pm by thomasdfg