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

Blocks                                          Functions



                                                This block allows you to access and use the current value
                              get
                                                stored in a variable.

                                                 This block assigns a new value to a variable. Like the get
                            set   to
                                                block, only variables within scope appear in the drop-down.


                 9.   Procedures Blocks: These blocks let you create reusable sets of instructions. They help
                     you avoid repeating code and keep your app organised.
                     Example:




                            Blocks                                          Functions




                             to  procedure2
                                                Collects a sequence of blocks together into a group.
                          result


                             to  procedure      Same as a procedure do block, but this procedure returns a
                                                result when called.
                          do






                           CREATING AN APP


                 In this activity, you will create an app that shows a multiplication table when a number is
                 entered. The app will display the results of multiplying the number by 1 to 10.

                 To make the Multiplication Table App, follow the given steps:

                 Step  1   Click on the New Project button and name it Multiplication_Table.

                 Step  2   Click on the Screen1 option and set AlignHorizontal to Center: 3 and AlignVertical

                           to Top 1.

                 Step  3   Drag a  Label from the  Palette  to  the Viewer, then set  its properties:  Text to
                           Multiplication Table, FontSize to 30, check FontBold and align it to Center.










                                                                                 Creating Apps with MIT App Inventor  125
   122   123   124   125   126   127   128   129   130   131   132