Page 206 - The Ultimate Palm Robot
P. 206

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






                                                  Chapter 7  Essential Robot Programming Strategies  189



                                      Every time the user taps the button, the program will display a message
                                    box that asks the user to enter a name.


















                                      If the user enters a non-empty string, the program will change the displayed
                                    phrase to “Hello, name.”


















                                      Here’s our program:


                                   //HelloWorld.c
                                   main() {
                                      int x, y, ev;
                                      string mymsg, name;
                                      graph_on();
                                      mymsg="Hello, World!";
                                      title(mymsg);
                                      while(1) {
                                        clearg();
                                        text(2, 15, mymsg);









           P:\010Comp\Bots\880-6\ch07.vp
           Monday, May 12, 2003 4:29:28 PM
   201   202   203   204   205   206   207   208   209   210   211