These blocks:
cause “ABC does not equal ABC” to be placed in Label2. The previous “set” doesn’t complete before the if is evaluated.
Please see more details and thoughts on Thunkable’s execution model in this Google doc:
These blocks:
cause “ABC does not equal ABC” to be placed in Label2. The previous “set” doesn’t complete before the if is evaluated.
Please see more details and thoughts on Thunkable’s execution model in this Google doc:
We’ll fix this so ABC == ABC (it’s a bug). Thanks for the detailed explanation.
Thanks, Paul. Can you also send me a short description of how the model works-- I want to explain that in the book I’m working on
Ok, ‘ABC’ === ‘ABC’ now.
https://x.thunkable.com/copy/7efdb89ef32b41644a87f12309ee1fba
Events will run uninterrupted until you reach a block that takes time to execute. While waiting for that block to execute, other events may run.
The user interface isn’t updated until a particular event handler completes or until there is a block that takes time to execute (whichever comes first).
Examples of blocks that take time to execute include (but are not limited to) the wait block, set/get/change stored and cloud variables.
An example of events running at the same time:
https://x.thunkable.com/copy/9e4e61a44dd19a03b8371c243d6bf6a5
Thanks, Paul, for the fix and the explanation.
I’m not sure I understand the example you sent for two events running at “same time”.
Thanks again,
Dave
When the button is tapped (just once) both events run. The background color of the button and screen change (“simultaneously”). Then after 0.5 seconds, the background color of the button changes. Lastly 0.5 seconds later the button and screen’s background color both change (“simultaneously”).
If you want a javascript analogy, think of the event handlers as calling Button1.addEventListener('Click', () => {change the colors...})
. If you add multiple listeners, then the multiple callback functions will be called.
This is an old thread, but I’ve had trouble several times recently with needing to add a wait block to make a piece of code work OK. Paul, you said that the user interface isn’t updated right away - are there other things that don’t update right away as well that thunkers should watch out for? I get the sense that variables in loops are sometimes also wonky?