Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 103 - 2612 Digimind C6
P. 103

    8.  Variables Blocks: These blocks  store  values that can change while the app  runs.  You  can
                       create, set and get variable values. Example:

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

                                                  This block assigns a new value to a variable. Like the get block, only
                                     set   to
                                                  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:

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

                                                   Same as a procedure do block, but this procedure returns a result
                                     to  procedure
                                                   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  101

| 98 99 100 101 102 103 104 105 106 107 108 |