# Button to stop process

**URL:** <https://community.thunkable.com/t/button-to-stop-process/3031452>\
**Category:** Questions about Thunkable X\
**Tags:** help, data-source\
**Created:** [May 29, 2024, 1:47pm UTC](https://community.thunkable.com/t/button-to-stop-process/3031452 "2024-05-29T13:47:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![franc.pozo2044](https://avatars.discourse-cdn.com/v4/letter/f/e9a140/32.png) [@franc.pozo2044](https://community.thunkable.com/u/franc.pozo2044)\
**Post date:** [May 29, 2024, 1:47pm UTC](https://community.thunkable.com/t/button-to-stop-process/3031452/1 "2024-05-29T13:47:11Z")

</div>

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

 ![Captura de pantalla 2024-05-29 a la(s) 10.38.55](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/b/7b550b7bdac49a82285b9b72b322190997b784a4.png)

---

<div class="post-metadata">

**Author:** ![matt\_conroy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/matt_conroy/32/150843_2.png) [@matt\_conroy](https://community.thunkable.com/u/matt_conroy)\
**Post date:** [May 29, 2024, 4:00pm UTC](https://community.thunkable.com/t/button-to-stop-process/3031452/2 "2024-05-29T16:00:09Z")

</div>

Hi @franc.pozo2044, welcome to Thunkable! 🎉

Be sure to check out our posts about [How to ask Great Questions v2.0](https://community.thunkable.com/t/how-to-ask-great-questions-v2-0/2689983/1) and our [Community Guidelines](https://community.thunkable.com/t/community-guidelines/78/8) 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](https://docs.thunkable.com/blocks/blocks/control#if-do-and-if-do-else) to check for the criteria where you’d want to stop executing the functions and let the conditions dictate whether this happens or not.

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [May 29, 2024, 4:58pm UTC](https://community.thunkable.com/t/button-to-stop-process/3031452/3 "2024-05-29T16:58:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![marion.dorsett](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/marion.dorsett/32/175129_2.png) [@marion.dorsett](https://community.thunkable.com/u/marion.dorsett)\
**Post date:** [May 29, 2024, 5:30pm UTC](https://community.thunkable.com/t/button-to-stop-process/3031452/4 "2024-05-29T17:30:30Z")

</div>

I would reccomend something like this:

 ![BtnStopProcess-00](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/2/a2b1d682820c664dfea9946712ef1443e8c4e516.png)

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [August 27, 2024, 5:31pm UTC](https://community.thunkable.com/t/button-to-stop-process/3031452/5 "2024-08-27T17:31:22Z")

</div>

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