Let's make it simple for you to explain. How does it behave and how do you want it to behave?


Set a flag and check it in your loop's condition.