Dec 192017
 
QUES is a batch file enhancement program that gets a YES, NO, or numeric response from the user and sets ERRORLEVEL accordingly.
File QUES22.ZIP from The Programmer’s Corner in
Category Batch Files
QUES is a batch file enhancement program that gets a YES, NO, or numeric response from the user and sets ERRORLEVEL accordingly.
File Name File Size Zip Size Zip Type
QUES.EXE 16144 7585 deflated
QUES22.DOC 10676 3073 deflated
TEST.BAT 2660 615 deflated

Download File QUES22.ZIP Here

Contents of the QUES22.DOC file





QUES Ver 2.2
-----------------------------------------------------------------
Logan M. Lewis Copyright (c) 1987-1991
February 10, 1991

Purpose:

QUES is a batch file enhancement program that gets a YES, NO,
or numeric response from the user and sets ERRORLEVEL
accordingly. The program can select a default response after
a user settable time interval. The following are the calling
parameters for the program.

Syntax:

QUES [/a][/b][/d][/f][/l][/m][/n][/r][/t][/u][/y]

Parameters:

/a Display user response
Causes the program to display "Yes" or "No" on the
screen to verify the users response. If the /r
parameter is used, a response in the numeric range 0-9
is displayed.

/b Background Text Color
Sets the background color for all text output by QUES.
Color values range from 0-7 as follows:
0 - Black
1 - Blue
2 - Green
3 - Cyan
4 - Red
5 - Magenta
6 - Brown
7 - White

EXAMPLE: /b1 (Set text background to Blue)

/d Default reply
Provides a default reply (YES or NO) to be assumed if
the user responds with a CR (Enter) or the timer is used
and runs out. If the numeric response switch (/r) is
set, the default reply will be between 1 and 9.

EXAMPLE: /dy (Set the default reply to Yes)
/d5 (Set the default reply to 5)





/f Foreground Text Color
Sets the foreground color for all text output by QUES.
Color values range from 0-15 as follows:
0 - Black 8 - Gray
1 - Blue 9 - Hi Blue
2 - Green 10 - Hi Green
3 - Cyan 11 - Hi Cyan
4 - Red 12 - Hi Red
5 - Magenta 13 - Hi Magenta
6 - Brown 14 - Hi Yellow
7 - White 15 - Hi White

EXAMPLE: /f10 (Set text color to Hi Green)

/l Line Feed Count
The user supplied text (/u) is displayed right where the
cursor is sitting when the program starts. If you want
some additional line feeds, this parameter will cause
from 1 to 5 to be inserted.

EXAMPLE: /l3 (inserts 3 line feeds--/l alone inserts 1)

/m Menu Response List
Allows the user to develop simple menus of up to nine
entries using any alphabetic or numeric character as the
menu entry selector. Case is ignored. Defaults (/d)
may be used but must be a value contained in the list.
Parameters /n, /r, and /y are ignored if /m is used.
Characters in the list assume an ERRORLEVEL equal to the
number of their position in the list.

EXAMPLE: /m12XY (a Response of 1 yields ERRORLEVEL 1
2 2
X 3
Y 4

/n ERRORLEVEL Value for a NO Response
Allows the user to set the ERRORLEVEL for a NO response
to any value between 0 and 98. However, the value
cannot be set the same as the YES value. If not set, NO
defaults to ERRORLEVEL=90. This parameter is disabled
if /r is used.

EXAMPLE: /n45 (Set the value for NO to 45)

/r Numeric Responses
The program accepts numeric responses in the range 0-9.
/n and /y parameters are disabled. If used in
conjunction with /d, default replies must be numeric in
the range 0-9.





/t Countdown timer setting (0-60 seconds)
If the timer value runs out before the user replies, the
program will automatically use the default reply value.
If no default reply is specified, the timer value is
ignored and the user must reply.

EXAMPLE: /t15 (After 15 seconds use the default reply)

/u User text string to display before reply
The text string following the "u" will be written to the
screen before the user's reply.

EXAMPLE: /uPlease enter your response (Y or n) -

/y ERRORLEVEL value for a YES response
Allows the user to set the ERRORLEVEL for a YES response
to any value between 0 and 89. However, the value
cannot be set the same as the NO value. If not set, YES
defaults to ERRORLEVEL=95. This parameter is disabled
if /r is used.

EXAMPLE: /y50 (Set the value for YES to 50)


Entering QUES without parameters causes a brief documentation
screen to be displayed. Parameter errors cause display of error
messages and program abort. If errors occur, the program
terminates with an ERRORLEVEL of 99.


APPLICATION NOTES:

QUES /dy /t5 /f14 /a /y1 /uPlease respond Yes or No or n!

Default response = YES
Timer = 5 seconds
Color = Yellow
YES Value = 1
User Supplied Prompt = "Please respond Yes or No or n!

If the user hits a key within 5 seconds, the response will be
accepted. Y produces a YES (Errorlevel=95), N produces a NO
(Errorlevel=90), ENTER or Carriage Return (CR) defaults to
YES. Anything else causes a beep and the program waits for
an acceptable entry. If no user entry occurs within 5
seconds, a response default of YES is generated. The
response accepted by the program will be displayed at the
current cursor position.





QUES /uPress ENTER to proceed or wait for 10 seconds./t10/dy

Default response = YES
Timer = 10 seconds
User Supplied Prompt = Press ENTER to proceed or wait for 10
seconds.

In this format, QUES may be used as a simple pause with an
automatic timeout. The users response is not displayed and
need not be tested.

QUES /mmsnx /uSelect (M) Many (S) Some (N) None (X) Exit - /dx
/f14 /t5

Acceptable replies = M/m, S/s, N/n, X/x
Errorlevel values = M=1, S=2, N=3, X=4
Timer = 5 seconds
User Prompt = Select (M) Many (S) Some (N) None (X) Exit -
Foreground = Bright yellow
Default value = X

Using the /m parameter, up to 9 user selected characters can
be used for the reply. Responses outside the defined set
will cause a beep and the program waits for a correct
response.

A test file TEST.BAT is included to show how QUES may be used and
the output tested.





REVISION HISTORY:

Ver 1.0 (Apr 1987)
- Initial release

Ver 1.5 (Dec 1990)
- Added countdown timer to continue automatically without user
response.

Ver 2.0 (Jan 1991)
- Replaced positional parameters with DOS style "/" switches.
- Added /p for automatic prompting.
- Added /a to allow display/non-display of user reply
- Added /c to allow selection of foreground color of text
written to screen.
- Added /y to allow selection of output ERRORLEVEL.

Ver 2.1 (Jan 1991)
- Changed name from ASK to QUES to avoid conflict with other
programs
- Added /f for foreground text color
- Added /b for background text color
- Allow user to set YES/NO ERRORLEVEL to any value in range
0-89.
- Added /l to insert line feeds before user text displays
- Added /n to set ERRORLEVEL value for NO
- Added /r to allow user to input response as a numeric value
from 1-9
- Deleted /p as unnecessary
- Deleted /c as unnecessary

Ver 2.2 (Feb 90)
- Added /m parameter for user selectable reply choices



PROGRAM INFORMATION:

QUES is written and copyrighted by Logan M. Lewis, and all rights
are reserved. It is distributed free of charge meaning you may
use and distribute the program with no requirement for payment to
the author; however, the program must be distributed with all
original files and documentation intact and unmodified.

The software is distributed as is. The author neither assumes
nor accepts any liability for the performance or behavior of the
program under any circumstances.

Comments may be left for Monty Lewis on the following BBSs:
The Break/East BBS, (703) 680-9269, or
The Pitt BBS, (703) 335-2925

QUES is written in Borland's Turbo Pascal 4.0.


 December 19, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)