Page 124 - 2611_SmartGPT Pro V(5.0) C-5
P. 124

The Blocks Editor lets you program the app’s behaviour by putting blocks together.



                                                                                                          Blocks Button




                         Built-in Blocks


                                                                         Blocks


                    Component-Specific
                         Drawers

                                                                                                          Viewer




                  The important sections of the blocks editor window:
                      Built-in Blocks: These are the basic blocks in MIT App Inventor (e.g., Control, Math,

                      Text) used to program app behaviour.
                      Component-Specific Drawers: Each component (e.g., Button, Label) has its own set of
                      blocks for controlling actions and settings.

                      Blocks Button: Switches you from the design area to the blocks area to write the app’s
                      code.
                      Viewer: The viewer is where you drag and drop blocks to create your app’s functionality

                      by connecting them like puzzle pieces.

                  DIFFERENT BLOCKS OF BLOCKS EDITOR

                  Built-in blocks are always available and provide basic tools for logic, text, variables and

                  more in the Blocks Editor.
                  1.  Control Blocks: These blocks manage the flow of the program using conditions, loops

                      and event triggers. They help you decide what happens and when. Example:



                             Blocks                                          Functions




                                if               Tests a given condition. If the condition is true, it runs the
                                                 specified blocks; if not, it skips them.
                             then

                                if
                                                 Tests a given condition. If it is true, the blocks in the then part
                             then
                                                 run; if it is false, the blocks in the else part run.
                             else



                  122   Computer Science (V5.0)-V
   119   120   121   122   123   124   125   126   127   128   129