Page 114 - Modular_V2.0_C++_Flikpbook
P. 114

Step 5    Drag  a  ListView from the  Palette to  the  Viewer.  The  ListView will display the
                            multiplication table after the user enters a number and clicks the Generate button.

                  Step 6    Click on Blocks in the top-right corner to switch to the Blocks Editor and start coding
                            the app's functionality.
                  Step 7    Click on Variables from the Blocks menu.

                            The list of coding blocks appears.
                  Step 8    Create  the  Global  Variable  List,  drag  the  initialize  global  name  to  block into  the
                            Viewer, then click on the name section and rename it to List.

                  Step 9    Add an Empty List from the  Lists category,  drag  the  create empty  list  block and
                            connect it to the List variable.
                  Step 10  Drag the initialize global name to block
                            into the  Viewer, then click  on the  name
                            section and rename it to Answer.

                  Step 11  From the Math category, drag the number
                            block  (0) and connect  it to the  Answer
                            variable.

                  Step 12  Click on Button1 from the list of components.
                            The list of coding blocks appears.
                  Step 13  Drag the when Button1.Click block into the Viewer.

                  Step 14  Inside the Button1 block, drag set global List to and connect create empty list from
                            the Lists category.

                  Step 15  Drag  set global Answer to and connect the
                            number block (0) from the Math category.
                  Step 16  Add a Loop for multiplication, inside the Button1
                            block, drag a for each number from 1 to 10 by 1
                            block from the Control category.

                            This loop will repeat 10 times, calculating
                            multiplication values from 1 to 10.
                  Step 17  Drag  the  set global  Answer to block from the

                            Variables section.
                  Step 18  Add the multiplication logic from the Math category, drag the addition block (+) and
                            connect it to set global Answer to.

                  Step 19  Set the first slot to get global answer from the Variables category, drag get global
                            Answer and place it in the first slot of the addition block.

                  Step 20  Add the input number from the TextBox1 section, drag TextBox1.Text and place it in
                            the second slot of the addition block.




                   112
                          Touchpad MODULAR (Ver. 2.0)
   109   110   111   112   113   114   115   116   117   118   119