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

  1. *
  2. * GOTO.CMD
  3. *
  4. * This script demonstrates some of the uses of the GOTO command.  In
  5. * particular the WHILE option of the Goto command is illustrated.
  6. *
  7.  
  8. *
  9. * This is a Label for a goto which comes later.  It could have been
  10. * entered as 'LABEL Top_Of_Goto' but the ':' form is easier to type
  11. * and to read.
  12. *
  13. * The first question just asks if they wish to continue or  not.  If
  14. * they enter anything besides 'NO' it will continue to ask.
  15. *
  16. :Top_Of_Goto
  17.  
  18.     Enter Local 0 Do You Want To Continue (Yes or No)?
  19.     Display The Answer Was: &0 
  20.  
  21. Goto Top_Of_Goto If Not Compare "&0" "NO"
  22.  
  23. AnyKey Local Message All Done Demo 1 ...
  24.  
  25. *
  26. * This example is very similar only it uses a defined variable to do the
  27. * GOTO.  This is a little easier to read.
  28. *
  29. Define ANSWER
  30.  
  31. :Top_Of_Test2
  32.  
  33.     Enter Local Answer Do You Want To Continue? 
  34.     Display The Answer Was: &answer 
  35.  
  36. Goto Top_Of_Test2 While Not Compare "&answer" "NO"
  37.  
  38. AnyKey Local Message All Done Demo 2 ...
  39.  
  40.