home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / uploads / z3help37.lbr / ASK.HZP / ASK.HLP
Encoding:
Text File  |  1993-06-07  |  4.1 KB  |  108 lines

  1. ;
  2.                                     ASK.COM                                   
  3.  
  4.              Size (recs) CRC   Version    Author/Latest Issue      Disk
  5.                6k (46)   1765  2.2        Richard Campbell 2/91    Z3COM1
  6.  
  7.   1- Syntax  2- Usage  3- Notes  4- Examples of Use                           
  8.  
  9.  
  10.    ASK is a version of the MS-DOS utility  which  allows testing of user input
  11. in batch files.  It is tailored for use with  zex/alias/arunz scripts and will
  12. only run on  Z-System  (ZCPR3x).   You must have the message buffers available
  13. to make use of this program.   Written in  BDS-C/Z vs 2.0  with  routines from
  14. Cam Cotrill's CFORZ02.
  15. :1     
  16.  Syntax      ASK "text prompt" choices [reg #]
  17.           or ASK @ row col "text prompt" choices [reg #]
  18.  
  19.  
  20.              [reg #] is optional, defaults to 0.
  21.              row, col = coordinates for prompt.
  22.              Regsiters 0-31 can be accessed.
  23.                   
  24.  
  25.    The "text prompt" allows the use of the macros  %<  and  %>  to set
  26.    upper and lower case prompts. 
  27.    
  28.    Converts ^X to its control character equivilant.
  29. :2
  30.  Usage 
  31.  
  32.    ASK uses the register portion of the  message  buffers  to return the users
  33. choice, so that the FCP (IF.COM) can test for it.  ASK also allows the user to
  34. choose which register will  store the input  value by specifying the  [reg #],
  35. registers 0-31 may be accessed.
  36.      
  37.    To use the program, simply supply a prompt string enclosed in double quotes
  38. followed by the single letter choices to choose  from.   The prompt string may
  39. include format commands to allow the prompt to be in upper and/or  lower case, 
  40. and to insert control characters in the prompt.
  41.      
  42.    To place your prompt anywhere on the screen,  supply the '@' (at) character
  43. after the name, followed by the row #,  and  column  #  for  the  prompt to be
  44. placed, the rest of the command is the same as stated above.
  45.  
  46.    Pressing any of the following  keys:   ESC,  Control-C,  Control-X,  or the
  47. RETURN key, will exit ASK.COM and set REG 0 to 0, and set the error flag to an
  48. error condition.
  49. :3
  50.  ASK Notes 
  51.  
  52.    a. Vs 2.2 updates (02/15/91, Richard Campbell):
  53.       - fixed bug in zputs()  routine in  Z3MSG.C  that allowed only uppercase
  54.         output.
  55.       - ASK22.LBR includes a C version of the GST02 program GXYMSG.COM,  which
  56.         allows the same type of output used in ASK22.COM.
  57. :4
  58.  Examples of Use 
  59.  
  60.    a. ask "b%>ackup, or %<r%>estore: " br
  61.  
  62.    b. ask "y%>our choice - %<abcd%>: " abcd
  63.  
  64.    c. ask "c%>hange to %<dir1:%> or %<dir2:%>?: " 12 1
  65.  
  66.    d. ask @ 12 5 "e%>nter %<A, B,%> or %<C%>: " abc 3
  67.           
  68.    In the case of the last example, the users input will be stored in the ZCPR
  69. register number 3 instead of 0.
  70.  
  71.    The following is a  script used  to  create  the DEL command similar to the
  72. MS-DOS command, this one checks for a null parameter, and if found, exits with
  73. the message: "no files.".   If it finds a parameter,  it displays the message:
  74. "deleting....", then checks if the parameter is ambiguous,  if so, it runs the
  75. ASK.COM program to display the "Are you sure? (Y/N): " prompt.  It then stores
  76. the users response in register # 0, (if response was valid!),  checks register
  77. 0 for the value of 1,  if equal to 1,  erases the file.   If the parameter was
  78. not ambiguous, it erases the file.
  79.  Examples of Use - 2/3 
  80.    
  81.    sample ALIAS script:
  82.           ;   
  83.           ;DEL - MS-DOS style file deletion command
  84.           ;
  85.           if ~null $1
  86.              echo %>deleting....
  87.              if ambig $1
  88.                 ask "a%>re you sure? (%<y/n%>): " yn 0
  89.                 if 0 1
  90.                    era $1
  91.                 fi
  92.              else
  93.                 era $1
  94.              fi
  95.           else
  96.              echo %>no files.
  97.           fi
  98.  Examples of Use - 3/3 
  99.  
  100.    The IF.COM program may have been used in  place  of  ASK.COM,  by using the
  101. INPUT option, e.g.:
  102.  
  103.           if input a%>re you sure? (%<y/n%>):
  104.  
  105.    I find that ASK.COM allows more flexibility in prompt choices by  combining
  106. the input features of IF.COM with the display features of  ECHO and the use of
  107. the Z3 registers.
  108.