Button to stop process

Hello, I press the button “button_A” and it executes “A, B, C and D”, how do I make it so that when I press the “button_B” the process carried out by “button_A” stops, I want it to stop where the process left off, whether in the execution of A B C or D

Hi @franc.pozo2044, welcome to Thunkable! :tada:

Be sure to check out our posts about How to ask Great Questions v2.0 and our Community Guidelines as you get started.

What is it that you are wanting to do within the four functions? The better way to do this might be to add in some conditionals to check for the criteria where you’d want to stop executing the functions and let the conditions dictate whether this happens or not.

create a (stored?) variable called to_run initial value 1 (1 means run)
inside when_button_b_click, set to_run to 0 (ie. don’t run)
inside EVERY block in your main flow, test for to_run=1 - hint use procedures/functions so to encapsulate whole chunk of code that you can turn on or off by applying the check to the call_function block

I would reccomend something like this:

I’m making a lot of assumptions for your use case, but each button should only call it’s own function.

The individual function should have a logic condition to determine if the next function needs to be called. So A will execute B, B will execute C, C will execute D and D will always execute.

In my example I assumed the need to trigger the next function was always false. If the random number in the range matches the static number in the condition, it will determine it does need to execute the next function, and if the condition to trigger the next function is true, it will proceed until through all of the following functions until it encounters a false value and stops.

Hopefully that makes sense.

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