prathimayellapragada Posted November 6, 2017 Report Share Posted November 6, 2017 Hi All, Can anyone help me with an answer, here is my question: Basically I have a variable in a text file which is T1 which has a number of times loop must execute. Basically I want repeat loop each time to pick a different value in iteration, is it possible ? My text file has: 4 5 I expect my repeat counter to repeat 4 times in first iteration and 5 times in second iteration, however I see that it is always considering 4 times. Can anyone help me on this please. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Samrae Posted November 6, 2017 Report Share Posted November 6, 2017 It is more difficult to help because you posted a screen shot instead of an actual macro. A macro can be attached to posts in this forum. Here are a couple of things that I would change: 1. If your testdat.txt file contains only one item per line I would use the Text File Begin/End Process commands instead of the ASCII File Begin/End Process commands. But, the ASCII File Begin Process should work. 2. Either of those commands put the content of the testdat.txt file into a variable. It is not necessary to include this command: Variable Set String %T1% from File: "Testdat.txt" 3. You may want to move this line just below the ASCII File Begin Process command: Variable Set %N1% to ASCII value of %T1% Quote Link to comment Share on other sites More sharing options...
rberq Posted November 6, 2017 Report Share Posted November 6, 2017 You have a loop within a loop. The outer loop is ASCII File Begin Process. The inner loop is Repeat With Variable Using N1. So yes, get rid of the line “Variable Set String %T1% from File: Testdat.txt" because each time through ASCII File Begin Process the next line of your file will be loaded into T1, which is what you want. Regardless of which line of the ASCII file has just been read, I think “Variable Set String %T1% from File” picks up the FIRST line all over again. That would explain why it always repeats 4 times regardless of what the file contains in subsequent lines. Also, I would recommend converting from text to integer with commandVariable Modify String: Convert %T1% to integer %N1% rather thanVariable Set %N1% to ASCII value of %T1%. In case %T1% contains blanks or newline/carriage-return characters, trim it before doing the conversion to integer. Quote Link to comment Share on other sites More sharing options...
prathimayellapragada Posted November 9, 2017 Author Report Share Posted November 9, 2017 Thanks for the reply! I actually got to know that i can select dropdown contents by typing in the text, so i was able to continue without issue. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.