Micro Focus QTP (UFT) Forums
Looping wont stop - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Looping wont stop (/Thread-Looping-wont-stop)



Looping wont stop - laura - 07-03-2009

Hi,
I have 3 values in a datasheet, with my code the datasheet keeps going on after the 3rd iteration which makes it fail.
Can anyone please help as the code actually works for other sections of the script.
My code is -

Code:
rc =datatable.getrowcount
for i =1 to rc
datatable.setcurrentrow i

------

Next

Can anyone tell me what is going on please.and i have set the File settings to 'run one iteration'

Thanks


RE: Looping wont stop - basanth27 - 07-05-2009

What does msgbox rc display ?


RE: Looping wont stop - laura - 07-06-2009

It was howing 5. i have now creted a new datasheet all is fine now. thanks for the idea of checking using msg box


RE: Looping wont stop - basanth27 - 07-06-2009

So your 2 rows were merely created from the 'virtual row" flag being set by QTP reading a imported excel. During these situations you must select the last 2 rows after the end of data and simply right click and then click on Delete. sometimes this helps, else just create a new sheet as you did.

In either case, You are most welcome :-)