home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / batch / batcher9 / answer.doc < prev    next >
Encoding:
Text File  |  1986-02-26  |  3.1 KB  |  73 lines

  1.  
  2.                          ╔════════════════════════╗
  3.                          ║         ANSWER         ║
  4.                          ║                        ║
  5.                          ║        VER. 1.0        ║
  6.                          ║                        ║
  7.                          ║  By: FRANK SCHWEIGER   ║
  8.                          ║                        ║
  9.                          ║         2/1/86         ║
  10.                          ║                        ║
  11.                          ╚════════════════════════╝
  12.  
  13. Have you ever wanted to ask a question and get an answer that you could
  14. use in a batch file?  This program is the ANSWER.  
  15.  
  16. I needed to ask for a directory and program name in a batch file I was 
  17. writing, and discovered there was absolutly no way to do it.  I wrote 
  18. ANSWER to fill that need.
  19.  
  20. The syntax for using ANSWER is:
  21.  
  22.         ANSWER [optional prompt]
  23.  
  24. ANSWER will display the optional prompt, and then accept input from the
  25. keyboard.  It will place the input in your CURRENT ENVIRONMENT AREA in a 
  26. field named ANSWER.  If "ANSI.SYS" has been loaded, the optional prompt may 
  27. contain any valid ANSI sequences to position the cursor, change color, etc.  
  28.  
  29. The user must have been previously notified that keyboard input is expected 
  30. or you must include the optional prompt to do so.  If the optional prompt is 
  31. not present, ANSWER will NOT DISPLAY ANYTHING that would inform the operator 
  32. that input is expected.
  33.  
  34. Parameters in the ENVIRONMENT AREA may be accessed similarly to command
  35. line parameters.  See the following examples for clarification:
  36.  
  37.    ANSWER Enter the full filespec for the source file:
  38.    COPY %ANSWER% junk.dst
  39.  
  40.    ANSWER Enter the Drive the source file is on (including :)-
  41.    SET DRIVE=%ANSWER%
  42.    ANSWER Enter the path the source file may be found in (including following \)-
  43.    SET COPYPATH=%ANSWER%
  44.    ANSWER Enter the Source filename-
  45.    COPY %DRIVE%%COPYPATH%%ANSWER% junk.dst
  46.  
  47. Note: The second example uses 3 parameters in the ENVIRONMENT AREA.  If you 
  48. have not expanded your ENVIRONMENT AREA, you may run out of space.  
  49.  
  50. ANSWER also sets a return code which can be examined by the ERRORLEVEL 
  51. option of the IF statement.  ERRORLEVEL will be 0 if ANSWER was sucessful, 
  52. or 1 if there was insufficient room or the ENVIRONMENT AREA was corrupted.
  53.  
  54.  
  55. This  program  is provided "as is" without warranty of any kind, either 
  56. expressed or implied, including, but not limited to, implied warranties of 
  57. merchantability or fitness for a particular purpose.   The entire risk as 
  58. to the results and performance of the program is assumed by the user.  
  59. Should the program prove defective, the user assumes the entire cost of all 
  60. necessary servicing, repair or correction.
  61.  
  62. This program is donated to the PUBLIC DOMAIN, and may be freely copied 
  63. without any restrictions.
  64.  
  65. Comments or suggestions may be forwarded to:
  66.  
  67.      Frank Schweiger
  68.      10083 Heytesbury Ln.
  69.      Sandy, Ut.    84092
  70.  
  71. I can also be reached on the STATION ZEBRA Bulletin Board in Salt Lake 
  72. City, Utah at (801) 561-4652.
  73.