Re: Storing values in2d array

59 views
Skip to first unread message

iRahulSingh

unread,
Jul 8, 2012, 11:59:08 AM7/8/12
to QTP - HP Quick Test Professional - Automated Software Testing
nikhil,

can you tell more how much memory are you allocating to this 2D Array
i.e Row_Col_Value(i,j)

Also why are not saving each row data in a seperate array and then
save these arrays in another array which somehow will make you play
with single arrays only.
dim mainarr()
dim rowarr()

redim mainarr(rowcount)
for r = 0 to rowcount -1
redim rowarr(columncount(r+1))
for c = 0 to columncount(r+1)
rowarr(c) = Browser("").Page("").WebTable("").GetCellData(r,c)
next
mainarr(r) = rowarr
erase(rowarr)
next

just a thought nothing else....

hope it helps ...

cheers..

On Jul 8, 12:46 pm, nikhil <nikhilco...@gmail.com> wrote:
>     For i=1 to rwcount
>                 For j=1 to colcount
>                         msgbox "i , j" & "=" & i & j
>             'Storing each value in an array
>
> Row_Col_Value(i,j)=Browser("").Page("").WebTable("").GetCellData(i,j)
>                         msgbox Row_Col_Value(i,j)
>               Next
>             Next
>
> why doesnt this work??
>
> I want to store each row values in 2 dimesnsional array.;

sujit kumar

unread,
Jul 8, 2012, 2:51:14 PM7/8/12
to mercu...@googlegroups.com
hi Nikhil 
what exactly error are you getting 
         msgbox Row_Col_Value(i,j) 
'if value are any number then then try this 
         msgbox Cstr(Row_Col_Value(i,j))

or please send me exact Error,I'll be happy to solve your problem.
-- 
Thanks  & Regards 
Sujit :) 

--
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 Kuntz

unread,
Jul 8, 2012, 8:44:07 PM7/8/12
to mercu...@googlegroups.com
Nikhil:

Consider using a nested dictionary to store data from a webtable and then pulling the data from the dictionary to compare values.  It works very nicely.

The url that explains how is http://www.advancedqtp.com/complex-dictionary-usage/

hth,


Parke
Reply all
Reply to author
Forward
0 new messages