Nested loop

Advanced programming using WinTask scripting language

Nested loop

Postby Betty on Fri Nov 13, 2015 9:02 am

Hello, I was wondering if you could provide some guidance on doing a nested loop from an excel file. All of my scripts use the loop feature, and need to now go into a subset of data and create another loop. I can add a line of data such as "end-of-record" to take me out of the nested loop, just not sure how to go back to the start of the first loop.
Betty
 
Posts: 22
Joined: Thu May 12, 2005 11:21 am

Re: Nested loop

Postby TechSupport on Mon Nov 16, 2015 10:47 am

Hello,
Here is a sample of a nested loop:
Code: Select all
Dim line1$(10)
Dim line2$(10)
file1$="firstexcelfile.xlsx"
file2$="secondexcelfile.xlsx"

i=0
j=0
repeat
   ReadExcel(file1$,"A"+str$(i)+":C"+str$(i),line1$())
   repeat
      ReadExcel(file2$,"A"+str$(j)+":F"+str$(j),line2$())
      j=j+1
   until line2$(j)=""
   i=i+1
until line1$(i)= ""

Regards.
WinTask Tech Support
TechSupport
 
Posts: 805
Joined: Thu Nov 16, 2006 9:58 am


Return to Scripts programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron