I'm writing a program that needs to perform a certain function with a "do until" loop, but if the task I want it to "do" is going to result in an infinite loop, I want the program to switch to a different "do until" loop. For example, I want it to perform task "x" and loop until y=0, but there will be some instances where the task in the initial loop will never cause y to equal 0, so if that is the case I want it to perform task "z" and loop until y = 0. The second loop will always eventually lead to y = 0, but how do I get the program to realize the initial loop is infinite/cannot be done if that is the case? I hope this isn't too vague...