How can I use a repeat loop in App Inventor?


Please provide more information on your question/concern, loop itself used to repeat things, but by repeat loop, do you mean to have nested loop?


1 Like

Hello user, welcome to the community!
Before making a post, please follow these instructions:


This book chapter should help:

Also see the Clock Timer event, for visible looping over longer periods of time.

1 Like

you can use this way:
first ad the clock

uncheck "TimerEnabled" and set Timerlnterval to the time you want the app to wait between any repeat.
check TimerAlwawsfires if you want the loop to work even if the app is minimized.
برنامه نویسی اندروید 11_10_2021 6_54_02 PM
now use these blocks to start the loop:blocks (1)
use this block to say the app what to repeat:component_event
to stop the loop, use these blocks:

Don't set the TimerInterval to 0ms, since this invalidates its use; you could use while/for instead. I believe @ABG's post qualifies it to be higher (at least 1000ms or more)...

Moreover, setting it to 0ms doesn't account for the processes taking place inside of the loop; which at least would take around ~5-6ms on a moderate phone. Ergo, it would overlap.

Really? Where?