The While block doesnt updates the condition

Sorry if I say something that doesnt have sense, english is not my native language.
I want to do an app where if you activate a check box, the app will going to do something all time until the user deactivate it. To do that, when the check box changes, while its checked it will do the actions and if is unchecked, does a break.
In my mind that has sense. When I check te box, the app do the actions but I cant un-checked it. It get stack and later crash the app.
What is the problem?

Use a clock timer instead of the while block

You created an endless loop


Maybe I dont understand the logic. In all loops the while block should "see" if the check box is activate, right?

When your blocks are running, they prevent the UI from being updated. So when you have a check for some UI state change in a while loop, the while loop runs constantly preventing the user from being able to check the box, creating an infinite loop.

1 Like

I didn't know that. Thanks everyone for your help.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.