home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / ibm1 / do101j2.arj / ASK.SCR next >
Text File  |  1991-12-27  |  2KB  |  53 lines

  1. .pg clr
  2.     »cy«COMMAND NAME»gy«: »%t« AnswerQuestion »ye«
  3.  
  4.     /ASK {variable} {Default} {Prompt} {maxlength} UC
  5. /CW
  6.     Calls »%t«GetString»#« using »cy«{variable}»#«, »cy«{default}»#«, »cy«{Prompt}»#«,
  7.     »cy«{maxlength}»#« and »cy«UC»#« then jumps to the resulting label
  8.     returned in »cy«{variable}»#« by calling »%t«GotoLabel»#«.
  9.  
  10.     This command allows you to "ask" questions and execute
  11.     portions of the script based on the answers given. See the
  12.     »%t«GetString»#« and »%t«GotoLabel»#« commands for information on these
  13.     specific portions of the »%t«AnswerQuestion»#« command.
  14. .pg
  15.  
  16.     Using »%t«DO»#«'s debug facility, we'll ask you to branch to a specific
  17.     label of your choice. The command will be displayed in reverse video
  18.     before it is executed.  Press »bo«<enter>»#« to execute the command.
  19. .pg
  20.  
  21.     First we'll use the »%t«/SET»#« command to set the »cy«{default}»#«
  22.  
  23. |/SET Default :OOPS!
  24.  
  25.     Then issue the »%t«/ASK»#« command
  26.     (Notice that you can use colors in your prompt.)
  27.  
  28.  
  29. /REPEAT
  30. |/ASK Label Default "    Enter '»ye«One»#«','Two' or 'Three': "  "" UC
  31. :One
  32. :Two
  33. :Three
  34. .re
  35.  
  36.    »ye«You entered one of the three choices.»#« It was also placed in
  37.    the text variable "Label". We'll expand it in this display block.
  38.    First, here's the display line we'll use:
  39.  
  40. |   You entered: »ma«%Label»#«
  41.  
  42.    As you can see, you can control script execution using the
  43.    »%t«/ASK»#« command and later use the variable.
  44. /GOTO ASK2
  45. :OOPS!
  46. .re
  47.  
  48.     »ye«You didn't enter one of the selections.»#« You entered: "»ma«%Label»#«"
  49.     or just hit the »ma«<Enter>»#« key so »%t«DO»#« branched to the
  50.     default label »cy«:OOPS!»#«
  51. :ASK2
  52. /ENDEXEC CLEAR
  53.