Bhaavin & Abhijeet:
Take a look at the url:
http://www.advancedqtp.com/complex-dictionary-usage/ for an example of
using nested dictionaries in QTP.
In the example below, I put arrays into nested dictionaries. The
initial key is unique.
option explicit
' arrays
dim arr1, arr2, arr3, arr4
' dictionaries
dim dic
Set dic = CreateObject("Scripting.Dictionary")
arr1 = array("1", "a2", "a3", "a4")
arr2 = array("2", "b2", "b3", "b4")
arr3 = array("3", "c2", "c3", "c4")
arr4 = array("4", "d2", "d3", "d4")
call array2dictionary (arr1)
call array2dictionary (arr2)
call array2dictionary (arr3)
call array2dictionary (arr4)
sub array2dictionary (arrName)
dim i
dic.Add arrName(0), CreateObject("Scripting.Dictionary")
dic(arrName(0)).Add "col2", arrName(1)
dic(arrName(0)).add "col3", arrName(2)
dic(arrName(0)).add "col4", arrName(3)
end sub
msgbox "Row 1, col 3 = " & dic("1").Item("col3")
msgbox "Row 4, col 2 = " & dic("4").Item("col2")
msgbox "Row 3, col 4 = " & dic("3").Item("col4")
msgbox "Finished"
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
Mercu...@googlegroups.com
> To unsubscribe from this group, send email to
>
MercuryQTP+...@googlegroups.com
> For more options, visit this group at
>
http://groups.google.com/group/MercuryQTP?hl=en
>
--
Parke
Cell:
770-842-0121