Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 115 - 2615_KEC
P. 115

    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.

                     Step 21  From the Lists category, drag the add items to list block into the Viewer and
                               connect it to global List to store multiplication results.

                     Step 22  Use the join block to format the multiplication statement from the Text category,
                               drag the join block and connect it to the item socket of the add items to list block.

                     Step 23  Add  TextBox1 input  as the  first number  from the  TextBox1 category,  drag
                               TextBox1.Text and place it in the first input of the join block.
                     Step 24  Add  the  multiplication symbol  (×) from  the  Text category,  drag  a  text  block
                               (empty quotes "") and type ×, then connect it as the next input in the join block.

                     Step 25  Add the loop number from the Variables category, drag "get number" and place
                               it in the join block after the × symbol.

                               This represents the multiplier (1 to 10).
                     Step 26  Add  the equals  symbol (=) from the  Text category,  drag another text  block,
                               type = and connect it as the next input in the join block.

                     Step 27  Add the computed answer from the Variables category, drag get global Answer
                               and place it as the final input in the join block.

                                                                                User Interface (UI) Programming and Logic  113

| 110 111 112 113 114 115 116 117 118 119 120 |