Madhavi,
it would more logical and optimized if you do the looping in the
following way
for i=1 to rc
GetCellData(i,3)
for j=i+1 to rc
GetCellData(j,3)
.....
This avoids comparing the same dates again...Hope this helps...
On Jan 27, 8:54 am, Madhavi Kotapati <[email protected]> wrote:
> Hi Ganadhar,
>
> In most of the cases table rowcount starts from 0.
> So in For loop
> Take like this
> "For i = 1 to rc - 1"
>
> In this case loop will start from 1st row to last row.
>
> Please let us know if this is not working.
>
> Thanks,
> Madhavi
>
> On Tue, Jan 27, 2009 at 5:50 AM, ganadhar <[email protected]>wrote:
>
>
>
> > Hi,
>
> > Just one change to the above code - the loop should start from 2
> > rather than 1 because the 1st row is the header.
>
> > Set TabObj=Browser("Browser").Page("Page").WebTable("Table")
>
> > rc=TabObj.RowCount
>
> > For i=2 to rc
>
> > Flag=True
> > checkforlowsetdate=Trim(TabObj.GetCellData(i,3))
>
> > For j=2 to rc
>
> > innertabledata=Trim(TabObj.GetCellData(i,3))
>
> > If (DateDiff("d", checkforlowsetdate, innertabledata)<0) Then
>
> > Flag=False
> > Lowestdate=innertabledata
> > Exit For
>
> > End If
>
> > Next
>
> > Next
>
> > Set TabObj=Nothing
>
> > Regards
> > Ganadhar
>
> > On Jan 22, 11:44 pm, vinay r <[email protected]> wrote:
> > > If thats the case then to get lowest date in the runtime ...........
>
> > > Set TabObj=Browser("Browser").Page("Page").WebTable("Table")
>
> > > rc=TabObj.RowCount
>
> > > For i=1 to rc
>
> > > Flag=True
> > > checkforlowsetdate=Trim(TabObj.GetCellData(i,3))
>
> > > For j=1 to rc
>
> > > innertabledata=Trim(TabObj.GetCellData(i,3))
>
> > > If (DateDiff("d", checkforlowsetdate, innertabledata)<0) Then
>
> > > Flag=False
> > > Lowestdate=innertabledata
> > > Exit For
>
> > > End If
>
> > > Next
>
> > > Next
>
> > > Set TabObj=Nothing
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
-~----------~----~----~----~------~----~------~--~---