Site hosted by Angelfire.com: Build your free website today!
Lesson 3 - Menu


 

    Menus in Ti-86 BASIC are simple.  This is the basic form:

:Menu(Location in the menu, Name of the menu selection, Label that it will go to if this menu part is selected

Here is an example:

:Lbl Top                                                ;Identifies label top
:ClLCD                                                 ;Clears the home screen
:Disp "Choose yes or no"                 ;Displays the words in quotes
:Menu(1,"No",NO,5,"Yes",Yes       ;Establishes a menu with No on the far left (1) and yes on the far right
:Lbl NO                                                 ;If no is picked, goes to this label
:ClLCD                                                 ;Clears home screen
:Disp "You choose no"                      ;Displays what you choose
:Pause                                                  ;Pause to let the user read
:Goto Top                                            ;Goes back to the top and back to the menu
:Lbl Yes
:ClLCD
:Disp "You choose yes"
:Pause
:Goto Top

    That's the basic form for menus. They are very useful, especially for choose your own adventure.  If you aren't writing the aforementioned, you'll probably use a menu once or twice in, say, a video game.