home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
batch
/
library
/
batutl2
/
answer.doc
< prev
next >
Wrap
Text File
|
1986-09-08
|
3KB
|
79 lines
¢4 L
ANSWER
VER. 1.0
By: FRANK SCHWEIGER
2/1/86
Have you ever wanted to ask a question and get an answer that
you could use in a batch file? This program is the ANSWER.
I had need to ask for a directory and program name in a batch
file I was writing, and discovered that there was absolutly
no way to do it. I wrote ANSWER to fill that need.
The syntax for using ANSWER is as follows:
ANSWER [optional prompt]
ANSWER will display the optional prompt, and then accept
input from the keyboard. It will place the input in your
CURRENT ENVIRONMENT AREA in a field named ANSWER.
If "ANSI.SYS" has been loaded, the optional prompt may
contain any valid ANSI sequences to position the cursor,
change color, etc.
The user must have previously displayed some indication that
keyboard input is expected or include the optional prompt to
do so. If the optional prompt is not present ANSWER will NOT
DISPLAY ANYTHING that would inform the operator that input is
expected.
Parameters in the ENVIRONMENT AREA may be accessed similarly
to command line parameters. See the following examples for
clarification:
Example 1:
ANSWER Enter the full filespec for the source file:
COPY %ANSWER% junk.dst
Example 2:
ANSWER Enter the drive ("d:") the source file is on:
SET DRIVE=%ANSWER%
ANSWER Enter the path ("path\") for the source file:
SET COPYPATH=%ANSWER%
ANSWER Enter the Source filename:
COPY %DRIVE%%COPYPATH%%ANSWER% junk.dst
The second example uses 3 parameters in the ENVIRONMENT AREA.
If you have not expanded your ENVIRONMENT AREA, you may run
out of space.
ANSWER sets a return code which can be examined by the
ERRORLEVEL option of the IF statement. ERRORLEVEL will be 0
if ANSWER was sucessful, or 1 if there was insufficient room
or the ENVIRONMENT AREA was corrupted.
This program is provided "as is" without warranty of any
kind, either expressed or implied, including, but not limited
to the implied warranties of merchantability or fitness for a
particular purpose. The entire risk as to the results and
performance of the program is assumed by the user. Should
the program prove defective, the user assumes the entire cost
of all necessary servicing, repair or correction.
This program is donated to the PUBLIC DOMAIN, and may be
freely copied without any restrictions.
Comments or suggestions may be forwarded to:
Frank Schweiger 10083 Heytesbury Ln. Sandy, Ut. 84092
I can also be reached on the STATION ZEBRA Bulletin Board in
Salt Lake City, Utah at (801) 561-4652.
¢0 L