Skip to first unread message

Scott Ferguson

unread,
Mar 12, 2016, 9:00:26 PM3/12/16
to mitappinv...@googlegroups.com
A common request is a 'wait' block to cause a delay in the app.
What is usually recommended is a Clock Timer event block to delay for the amount of time required.

The attached snippet attempts to simplify this by eliminating the Timer event block and the global variables usually required.
It uses an existing Clock instance in the app.
Upon cursory examination it appears to work as the delay happens as expected.
However, the blocks before the delay procedure will not execute as explained by Taifun's analysis in this thread.
So follow his recommendations in this thread which use a Clock Timer event block.
---
delaynew.PNG

Taifun

unread,
Mar 13, 2016, 10:47:17 AM3/13/16
to mitappinv...@googlegroups.com
What is usually recommended is a Clock Timer event block to delay for the amount of time required.
yes, exactly, the reason is to not block the device, this is also explained here 
but why are you using an advanced clock block?
you also could have done it like this


Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun. 

Taifun

unread,
Mar 13, 2016, 11:44:37 AM3/13/16
to mitappinv...@googlegroups.com
my recommendation is to use Scott's "Please Wait" solution, which uses a clock component to wait for several seconds without blocking the device here https://groups.google.com/d/msg/mitappinventortest/m8i32I2m200/-cz21HLcvv4J
Taifun


Scott Ferguson

unread,
Mar 13, 2016, 10:19:01 PM3/13/16
to MIT App Inventor Forum
Let's make this a counter-example, then.
I should have used your blocks for testing output before the delay.
My focus was on getting the delay to work with fewer blocks.
I should have known better and forgot about the posts that you cited which are simple enough.
---

Reply all
Reply to author
Forward
0 new messages