Control Blocks
if
Tests a given condition. If the condition is true, performs the actions in a given sequence of blocks; otherwise, the blocks are ignored.
ifelse
Tests a given condition. If the result is true, performs the actions in the
then-do
sequence of blocks; otherwise, performs the actions in the
else-do
sequence of blocks.
choose
Tests a given condition. If the condition is true, performs the actions in the
then-do
sequence of blocks and returns the
then-return
value; otherwise, performs the actions in the
else-do
sequence of
blocks and returns the
else-return
value.
foreach
Runs the blocks in the
do
section for each item in the list
in
list
. Use the given variable name to refer to the current list item.
for range
Runs the block in the
do
section for each numeric value in the range
from start to end, stepping the value each time. Use the given variable name to
refer to the current value.
while
Tests the
test
condition. If true, performs the action given in
do
, then tests again. When
test
is false, the block ends.
get start text
Returns the text passed to this app when the app was started, if any.
close screen
Closes the app.
close screen with result
Closes the app and sets the variable APP_INVENTOR_RESULT to the given value.