Page 1 of 1

Ending loop after last file is opened.

Posted: Thu Oct 23, 2008 10:44 am
by jmarinov
Team, can you please provide some guidance on what is a quick and efficient way to end a file loop which reads or opens files.At present I have code which loops in infinity but what is a way for it to stop at the last file and end the process.Do you have a quick algorithm you can share - I know how to create a variable which will count the files, but how do I create the step where robotasks compares the variable with the actual current number of the current file and if they are equal it stops the process.

Ending loop after last file is opened.

Posted: Mon Oct 27, 2008 12:34 pm
by verona
In "Loops and Flows" create an "If Then" action where you compare your counter versus the number of files (make sure you check "As Number" for the comparison type)
Then add a "Break" and an "End If" (also from "Loops and Flows") The "Break" will get you out of whatever loop you're in.