Blocks
keyboard_arrow_up
Add
Control
Index
-
- If & if else
- For each from to
- For each in list
- While
- If then else
- Do
- Evaluate but ignore result
- Open another screen
- Open another screen with start value
- Get start value
- Close screen
- Close screen with value
- Close application
- Get plain start text
- Close screen with plain text
-
Control Blocks
- If & if else
- It serves to prove a condition. If the condition is true, it will perform an action and if it is false these actions will be ignored.
- This block can be more complicated and add different conditions.
- For example, define what actions will be taken if the condition is not met.
- For each from to
- This loop executes the blocks contained in "Do" for each numeric value contained in the range "from" - "to", being able to modify the value in "By". We can also change the variable number by which we want our application.
- For each in list
- This loop allows you to perform actions for each item in the list. We can change the value of the element, whichever one we want, whenever it is a list.
- While
- This loop checks the condition continuously, as long as it is true, the "Do" blocks will be executed for each check. When the condition is not met, the loop ends.
- If then else
- This block checks a condition. If this is true, it returns a value, if it is false, it returns another value.
- Do
- This block can be used to avoid creating a procedure, indicating the block to be executed and when it finishes returning a result.
- Evaluate but ignore result
- It provides a "simulated socket" to place a block that has a slot to the left in a place where there is no socket / slot, like a sequence of blocks in the part of a procedure or a block if. The block in which it is adjusted will be executed, but its returned result will be ignored. This can be useful if you define a procedure that returns a result, but you want to call it in a context that does not accept a result.
- Open another screen
- Open the screen whose name we indicate.
- Open another screen with start value
- Open the screen whose name we indicate and passing a value.
- Get start value
- Returns the start value of the current screen, this value can be obtained by opening another screen or closing it.
- Close screen
- Close the current screen.
- Close screen with value
- Close the current screen and return a value to the new screen.
- Close application
- Close application.
- Get plain start text
- Returns the flat text obtained on the screen that started this application. If no value was passed, the returned text will be empty. In applications with multiple screens, it is better to use the start value than to obtain the text.
- Close screen with plain text
- Close the current screen and pass the text to the application that opened it. This command is used to return text to activities that are not App Inventor, not App Inverntor screens. For App Inventor screens, as in multiple screen applications, it is recommended to use Close screen with value and not with plain text.