top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to create an array of dictionaries in QTP?

+2 votes
517 views
How to create an array of dictionaries in QTP?
posted May 14, 2014 by Rahul Mehra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

We can create the array of dictionary like how we create array of scalar variables.
Syntax is shown below:
'Declare Array with 5 elements

Dim myArray(5) 

'Make first element in array as a dictionary object

Set myArray(0) = createobject("scripting.dictionary")

'Once we have a dictionary object, We can use its methods like add, remove, removeall etc

myArray(0).Add"mykey","myvalue"

'display item value of mykey in dictionary myArray(0)

print myArray(0)("mykey")

myArray(0).removeall 
answer May 15, 2014 by Anuradha Tabyal
Similar Questions
0 votes

I want to create a random float array of size 100, with the values in the array ranging from 0 to 5. I have tried random.sample(range(5),100) but that does not work. How can i get what i want to achieve?

+2 votes

consider an example :
if an array is: 2 -1 2 4 6 -5
then maximum sum of contiguous array is 13, from index 0 to index 4
constraints: complexity must not be greater than O(n).

...