Trouble with For loop - 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: Trouble with For loop (/Thread-Trouble-with-For-loop) |
Trouble with For loop - Mala - 06-15-2011 When the inner for loop is over the controls are passing to the next higher for loop but gets stuck in the first statement of the outer for loop saying the parameter is incorrect. Here is the code I am using Code: For i = 1 To 4 ---- When the inner loop is complete the next value in ---------the datatable is not retrieved and the error pops up 'parameter --------incorrect' Any ideas please RE: Trouble with For loop - manishbhalshankar - 06-16-2011 Hi Mala, Your are using datatable in for loop and fetching data from it. Is your data in different rows and are you using DataTable.SetCurrentRow(parameter)? If so, then use datatable.setcurrentRow(i) as first statement of your outer for loop. Please let me know if this is not the case. Also please share the complete piece of code if possible. RE: Trouble with For loop - Mala - 06-16-2011 Thanks Manish, I was using DataTable.GetSheet(dtGlobalSheet).SetCurrentRow but then changed to DataTable.GetSheet(dtGlobalSheet).SetCurrentRow(i) later and got the results. However I had to make changes to the inner loop also the same way and made it DataTable.GetSheet(dtGlobalSheet).SetCurrentRow(j). Now it works fine. |