Page 152 - The Ultimate Palm Robot
P. 152

Color profile: Generic CMYK printer profile
           Composite  Default screen
                                                          Bots /The Ultimate Palm Robot/ Mukhar & Johnson / 222880-6 / Chapter 6






                                                      Chapter 6  The Palm Robot Programmer (PRP)     135



                                    means. However, if you create a constant named Servo0 and set its value to 0,
                                    you can use the constant Servo0 in the code every time you want to use the
                                    value 0. Anyone reading your program has a better chance of understanding
                                    what Servo0 refers to in comparison to just 0. Java and TEAsupport constants.
                                    These languages will not allow you to change the value of a constant.










                                    The If Component   The If component allows your code to make a decision
                                    based on some condition. The property for this component is the logical
                                    condition to test for. When you add an If block to your program, the PRP
                                    automatically adds an End If block. Program blocks between the If and End If
                                    blocks are executed when the condition is true. The condition can use values,
                                    variables, constants, and any number of operators.
















                                      Some of the operators are listed here:
                                        ❏ ==    equals (TEA or Java)
                                        ❏ =   equals (Basic)
                                        ❏ !=   not equals

                                        ❏ <   less than
                                        ❏ <=    less than or equal to
                                        ❏ >   greater than
                                        ❏ >=    greater than or equal to
                                        ❏ &&     and
                                        ❏ ||    or







           P:\010Comp\Bots\880-6\ch06.vp
           Monday, May 12, 2003 1:06:23 PM
   147   148   149   150   151   152   153   154   155   156   157