Ending loop after last file is opened.

Discuss RoboTask here
Post Reply
jmarinov
Posts: 4
Joined: Mon Oct 20, 2008 8:54 am
Location: United States

Ending loop after last file is opened.

Post 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.
verona
Posts: 24
Joined: Wed Jun 25, 2008 4:16 pm

Ending loop after last file is opened.

Post 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.
Post Reply