06-07-2010 12:12 PM
I want to use on stop button to stop mutilple while loop at the same time. But if I put the stop button outside the while loop, it is functional.
Is there any way to do that?
Thanks
06-07-2010 12:18 PM
Set the stop button mechanical action to Switch When Pressed (or Released). Create a local variable for each loop you want to stop minus 1. Put the stop button in one loop and put a local in each of the others. Wire all to the stop signs. Pressing the stop button will stop all loops. You will have to set the stop button back to False at the end of your code.
06-07-2010 12:56 PM
cguan wrote:But if I put the stop button outside the while loop, it is functional.
06-07-2010 01:12 PM
As a suggestion, you might try doing a search before posting the question -- this question has been asked and answered many times. There are lots of different ways that you can use a single button to stop multiple loops.
Here is a good discussion on various ways to accomplish what you want to do.