My problem is with this section below. I would like it to stop as soon as the overall loop is called again (at the press of a button). I have tried to use the “break out of loop” block, but I haven’t gotten it to work the way I want to. If you see a way to achieve this, please let me know.
I wouldn’t quite understand how to integrate this directly into your app without a project link of some description, though this doesn’t seem too difficult to implement based on the blocks you’ve provided.
If you’ve any bother with this, just drop a reply here
Thank you, I hadn’t thought of that before. This may be an obvious question, but I haven’t used functions or forever loops much:
Would there be a way to stop this after a certain number of repeats?
In this case, it could be stopped if the larger event were called again (entire block in first screenshot), but would definitely stop after looping 14 times (as i showed in the second screenshot). Clear as mud?
This will repeat 10 times, unless it is stopped. If I were to start this again by clicking the Start Button then it would repeat it another 10 times. Is this what you would like?
Functions are great, and actually very easy to use with Thunkable. Check out the docs on Functions.
Many thanks for the solution. If you’re up for it, another problem has popped up in it’s wake.
This new issue comes as a result of the repeat block continuously going in the background. If events happen fast enough, an old call of the function will register that the variable has changed back, and events will happen from both the new function being called, as well as the old one.
I need the function to completely stop once the variable tells it to. That way, it won’t interfere if the function is called again
Breaking a loop should jump to the next line of code, or at least that is the intended idea of a break.
Do you mind sharing some screenshots just highlighting the misfitting blocks? If you think it’s an issue of the loop going too fast you can add a wait block. Do keep in mind if a block has a then do at the end, this usually means the block may take extra time to execute. In this scenario, you should use the then do option, unless intended otherwise.
This issue is directly related to my previous question. It is the need for an edited solution to what was answered on this thread. This is what I ended up with after your solution:
For the sake of understanding, I’m referring to the calling of function “load_Bar”, as well as the function itself running. Let’s say it is called once. It checks 14 times if it needs to break the cycle, and each is spaced out by a variable wait, which will decrease as time goes on (to make the game harder). It starts at .5 seconds. If the function is called a second time before the total wait (7 seconds) is up, the new instance of the function will work (because it has just been called) in addition to the old instance of the function (which senses that the variable {break_Loading_Bar_Cycle} has opened the loop again). Therefore, the results will be doubled. This is bad.
I need a solution that as soon as the variable {break_Loading_Bar_Cycle} says so, that instance of the function “load_Bar”, or included loop, is permanently closed to make room for the new one.