Micro Focus QTP (UFT) Forums
Keep row number - 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: Keep row number (/Thread-Keep-row-number)



Keep row number - imbizile - 09-18-2014

Hi all,

Im having trouble making QTP do a For loop with stuff for 100 rows in a DataTable, then do different stuff 1 time and do the first stuff again for the next 100 rows (ie row 101-200), rinse and repeat with 100 rows each time. My problem is that it starts at row 2 after doing the code first time and I need it to continue from row 101 instead.

For clarification I added a msg box in the code and what im trying to accomplish is for that to add 1 each time, also between running full circle in the code (ie for each 100 rows). So lets say after doing 400 rows the msgbox should say 400 and the "do different stuff" code would then have been done 4 times.

Code:
Dim x

For x = 1 To 100

'Do stuff
msgbox DataTable.GlobalSheet.GetCurrentRow

Next

'Do different stuff 1 time and then start the For loop again from row 101

Is it in any way possible to "save" the row number and continue from that after doing the full code?

I would really appreciate any effort spend helping Smile

Using QTP 11 and in settings its set to run on all rows