Page 1 of 1

stop a program

Posted: Thu Aug 16, 2012 12:45 am
by Nau2306
Hello

I am currently running a for loop with 1000 estimations, I would like to know if there is a way to skip an estimation by imposing certain conditions without it displaying an error message and stopping the program.

Thanks

Re: stop a program

Posted: Thu Aug 16, 2012 5:26 am
by bhaupt

Code: Select all

for !i = 1 to 10000 [program iterations] if [condition] then exitloop endif next
or alternatively

Code: Select all

!i = 1 !exit = 0 while !i <= 10000 and !exit=0 [program steps] if [condition] then !i = !i + 10 'here I am allowing for a conditon to decrease the number of iterations endif if [condition] then !exit = 1 ' here I am allowing for a condition to exit the loop at the wend. endif wend