home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / PLINESYS.ZIP / KEY.CMD < prev    next >
Encoding:
Text File  |  1991-03-15  |  1.1 KB  |  57 lines

  1. *
  2. * KEY.CMD
  3. *
  4. * Test the IF KEY functions including responses from previous AnyKey
  5. * commands.  This is somewhat useful for logical branching.
  6. *    This is an example of doing menus
  7. *
  8.  
  9. Label Top
  10. OnError Ignore                // This comment should be ignored
  11.  
  12. * Print the Menu
  13. Clear
  14. Display                        // This comment should be ignored
  15.  
  16. Current Time: &TIME Date: &DATE
  17.  
  18.      Enter:
  19.          A - For Option A
  20.          B - For Option B
  21.          C - For Option C
  22.  
  23.  
  24. EndDisplay
  25.  
  26. *
  27. * Get the Response
  28. *
  29. AnyKey Local "Enter Option ABC or [RETURN] to Exit"
  30.  
  31. If Key ABC                // This comment should be ignored
  32.     If Key A
  33.         AnyKey Local "A - is a good choice ..."
  34.         Goto Top
  35.     EndIf
  36.     If Key B
  37.         AnyKey Local "B - is a good choice ..."
  38.         Goto Top
  39.     EndIf
  40.     If Key C
  41.         AnyKey Local "C - is a good choice ..."
  42.         Goto Top
  43.     EndIf
  44. EndIf
  45.  
  46. If Key ^M            // This comment should be ignored
  47.     AnyKey Local "Pressed [RETURN] Exiting ..."
  48.     Clear
  49.     Exit
  50. EndIf
  51.  
  52. // Else some invalid choice
  53. AnyKey Local "Invalid Choice ... Press [RETURN]"        // This comment should be ignored
  54. Goto Top
  55.  
  56.