home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
games
/
batwin40.zip
/
BATWIN.DOC
next >
Wrap
Text File
|
1989-05-01
|
19KB
|
500 lines
BATWIN 4.0
This is a collection of processors which can be called from BAT files to
interface with the user. I created them for two purposes:
1) To make fancy BAT files
2) Many "menu"-type programs available don't allow much
interaction with the user to select parameters, etc for the
batch stream associated with a menu selection. These
processors, when placed in the batch streams, can solve that
lack.
Execute DEMO.BAT for a brief demonstration of the processors.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
BMSGWIN - Display a message in a "window" box
Call: BMSGWIN row col attribute "string"
row - row on which string is written (0-22)
col - column for first character of string (0-79)
attribute - color of string display (see below)
"string" - string to display, must be in quotes
NOTE: The box will appear on the rows above and below the string.
The width of the box depends on the length of the string.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
BPOPLIST - Display a list of items in a window and let user make a choice,.
supports the mouse.
Call: BPOPLIST ulrow ulcol height attribute file
ulrow - row in which upper border of box appears
(0-(23-height))
ulcol - column for upper left corner of box border
(0-(79-width))
height - inside dimension, height of box
attribute - color of display (see below)
file - ASCII file containing choices
The ASCII file has the following format:
lines: Strings to appear as choices
First string is choice #1, next is choice #2, etc.
Example:
EPSON
IBM GRAPHICS
HP LASERJET
The items will be displayed in the window. If there are more items than
the height specified, the window will scroll. If there are fewer items
than the height specified, the window will be shorter. The width of the
window is determined by the longest item or title length.
The mouse may be used to select items by placing the mouse cursor on the
item and clicking the left button. The items may be scrolled by clicking
on the arrows on the right border. Pressing the right button is the same
as pressing ESC.
The users choice is returned in ERRORLEVEL. If ERRORLEVEL = 127, ESC was
pressed; if it = 99, an error occurred.
Pressing F1 displays help if in non-mouse mode.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
BWARN - Display a warning box , supports the mouse
Calls:
BWARN ulrow ulcol attribute title "string1" "string2"
ulrow - row in which upper border of box appears (0-16)
ulcol - column for upper left corner of box border
(0-(79-width))
attribute - color of display (see below)
title - Blinks on top border ex. WARNING
"string1" - First explanation string in window (optional)
"string2" - Second explanation string in window (optional)
If no strings given, a default " Choose Action " is
displayed.
┌────── TITLE ─────┐
│ <string1> │
│ <string2> │
│ │
│ CONTINUE ABORT │
│ │
└──────────────────┘
Either CONTINUE or ABORT will be highlighted. The user can select one
or the other by:
- Pressing C or A and then RETURN
- Pressing the right and left arrows and the RETURN
- Pressing the SPACEBAR or TAB to toggle back and forth and then
pressing RETURN
- Move the mouse right and left and then press the left button.
Returns:
- 0 if user selected CONTINUE
- 1 if user selected ABORT, presssed ESC or the right mouse button
Pressing F1 displays help.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
BDIALOG - Display a dialog box , supports the mouse
Calls:
BDIALOG ulrow ulcol attribute title "string1" "string2"
ulrow - row in which upper border of box appears (0-16)
ulcol - column for upper left corner of box border
(0-(79-width))
attribute - color of display (see below)
title - Blinks on top border ex. WARNING
"string1" - First explanation string in window (optional)
"string2" - Second explanation string in window (optional)
If no strings given, a default " Choose Action " is
displayed.
┌────── TITLE ─────┐
│ <string1> │
│ <string2> │
│ │
│ YES NO CANCEL │
│ │
└──────────────────┘
Either YES, NO or CANCEL will be highlighted. The user can select one
or the other by:
- Pressing Y, N or C and then RETURN
- Pressing the right and left arrows and the RETURN
- Pressing the SPACEBAR or TAB and then pressing RETURN
- Move the mouse right and left and then press the left button.
Returns:
- 0 if user selected YES
- 1 if user selected NO
- 2 if user select CANCEL or presssed ESC or the right mouse button
Pressing F1 displays help.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
BPAUSE - Put up message and wait for keystroke
Call: BPAUSE row col attribute "string"
ulrow - row in which upper border of box appears (0-21)
ulcol - column for upper left corner of box border (0-nn)
attribute - color of string display (see below)
"string" - string to display, must be in quotes
This is optional; if not given, the message
" Press any key to continue "
will be displayed.
NOTE: The width of the box depends on the length of the string.
The box can be moved around the screen using the cursor keys or mouse.
Any other keypress terminates the program, closing the window and returning
the ASCII code for the keypress in Errorlevel; Function keys, etc return
a 0 in Errorlevel.
If a mouse is used, the right button returns 27 and the left button
returns 13.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
BCHDIR - Change directory using point-and-shoot, supports the mouse.
Call: BCHDIR ulrow ulcol attrib
ulrow - row in which upper border of box appears (0-20)
ulcol - column for upper left corner of box border (0-nn)
attrib - color of string display (see below)
BCHDIR pops up a window showing the subdirectories available from the
current subdirectory, as well as the ".." directory. The user can move
the highlight bar to a displayed directory. If RETURN is pressed that
directory is displayed, etc. If ESC is pressed, the working directory
is changed to the displayed directory and BCHDIR exits.
If a mouse is used, a directory can be selected by moving the mouse
cursor over it and clicking the left button. Clicking the right button
selects the current directory.
Pressing F1 displays help.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
BEPSON, BIBMGR, BHPLJ, BUNISYS - Select and send control strings to printer
Calls: BEPSON ulrow ulcol attrib (EPSON printers)
BIBMG ulrow ulcol attrib (IBM Graphics printers)
BHPLJ ulrow ulcol attrib (HP Laserjet printers)
BUNISYS ulrow ulcol attrib (UNISYS Model 37 laser printer)
Maximum values: ulrow ulcol
----- -----
BEPSON, BIBMG 17 66
BHPLJ 17 64
BUNISYS 10 64
These programs pop up a window which describes the common control
strings which might be sent to the printer. The user selects the
desired function and presses RETURN; the control string is sent to the
printer and the program exits. If the user presses ESC, the program
exits without sending a string.
Mouse is supported in the same manner as BPOPLIST; the left button
selects the string under the mouse cursor, the right button exits
without sending a string.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
BWINDOW - Draw a box ("window") on the screen
Call: BWINDOW ulrow ulcol height width attribute
ulrow - row in which upper border of box appears (0-20)
ulcol - column for upper left corner of box border (0-79)
height - inside dimension, height of box
width - inside dimension, width of box
attribute - color of display (see below)
BPUTS - Write a string on the screen
Call: BPUTS row col attribute "string"
row - row on which string is written (0-23)
col - column for first character of string (0-79)
attribute - color of string display (see below)
"string" - string to display, must be in quotes
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
BTEXTWIN - Display a popup text window
Call: BTEXTWIN ulrow ulcol attribute txtfile
ulrow - row in which upper border of box appears (0-20)
ulcol - column for upper left corner of box border (0-79)
attribute - color of display (see below)
txtfile - ASCII text file contains text for window
Displays a pop-up window on the screen. The window height is determined
by the number of lines in the file, the width by the length of the
longest line in the file.
The window will remain on the screen until a key is pressed or 10 seconds
expires. In either case, it will disappear.
Error codes: 0 = Time expired, or function key pressed
99 = Error, no enough parameters, window won't fit
etc.
other = ASCII code of key pressed (see bpause)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
BLOCATE - Locate cursor on screen
Call: BLOCATE row col
row - row on which to locate cursor (0-23)
col - column in row (0-79)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
BSAVESCR - Save screen contents to a file
Call: BSAVESCR file
BRESTSCR - Restore screen contents from file created by BSAVESCR
Call: BRESTSCR file
Note: Cursor must be repositioned.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
BXQTDIR - Change current subdirectory to the subdirectory containing BXQTDIR
Call: BXQTDIR
Place BXQTDIR in a subdirectory which is in the PATH. Whenever, it
is executed it changes the current directory to directory in which it
resides. This would be useful if the BAT file needed to CHDIR to the
directory containing something, but you either didn't know what that
directory would be or various computers used different directories.
If you use BXQTDIR in conjunction with PUSHDIR and POPDIR , which can
usually be found on BBSs, you could
PUSHDIR ; save current subdir
BXQTDIR ; change dir
POPDIR ; restore previous subdir
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
BFILEDIR - Change current subdirectory to the subdirectory in which the
named file exists
Call: BFILEDIR file.ext
BFILEDIR searches for "file.ext", first in all directories in the
PATH and then, if unsuccessful, it scans all directories on the
current drive (or another drive, if indicated). When "file.ext" is
found, BFILEDIR does a CHDIR to the subdirectory containing
"file.ext".
This could also be used with PUSHDIR/POPDIR (note, however, that
these programs don't handle change of drive).
ERRORLEVEL codes returned: 0 = Success, directory changed
40 = Failure, couldn't find file,
directory unchanged
99 = Error, no file.ext given
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
MOUSE:
Many of the programs support a mouse, if present. The mouse movements
are translated into cursor keys in some programs while others use the
mouse cursor (see above). The left button is treated as ENTER, and
the right button is treated as ESC.
BPOPLIST, BCHDIR and the printer menus use the "mouse cursor" to select
items.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
ERROR CODES:
All processors return a value in ERRORLEVEL.
0 - Normal completion, no error (except BPOPLIST)
99 - Error termination
Either not enough parameters or window too tall.
The BPOPLIST program returns the number of the selection in errorlevel, or
it returns 127 if ESC was pressed.
BWARN returns 0 if CONTINUE was selected, 1 if ABORT was selected or ESC
was pressed, 99 if an error occurred.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
ATTRIBUTES:
All of the programs require a color attribute to be specified. The chart
below can be used to compute this value. The formula is as follows:
(bg*16)+fg+extra (extra = value for BLINK)
Background Foreground
---------- ----------
0 BLACK 0
1 BLUE 1
2 GREEN 2
3 CYAN 3
4 RED 4
5 MAGENTA 5
6 BROWN 6
7 Lt. Grey 7
Dark Grey 8
Lt. Blue 9
Lt. Green 10
Lt. Cyan 11
Lt. Red 12
Lt. Magenta 13
YELLOW 14
WHITE 15
Add 128 for BLINK
MONOCHROME ADAPTERS:
It has come to my attention that specifying colors when running on a
monochrome or Hercules monitor causes problems in BPOPLIST and
BWARN; the highlight bar is not visible. To solve this, BPOPLIST
and BWARN now check for monochrome, Hercules and Hercules Plus
adapters and set color to white on black, regardless of the
specification on the call line. However, this still leaves the
problem of a monochrome monitor driven by a CGA board. In order to
solve this problem, BPOPLIST and BWARN test the environment for
BATCOLOR=MONO; if found, color is set to white on black. To set
this up, enter
SET BATCOLOR=MONO
in DOS or from a BAT file (such as AUTOEXEC.BAT). If you have
troubles with running out of environment space, see the description
of the CONFIG.SYS SHELL command in your DOS documentation.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
HISTORY:
1.0 First release.
1.1 Same as first release, except missing POPTEST.TXT included.
2.0 Added BPAUSE.
2.1 Added handling of mono screens to BPOPLIST and BWARN.
2.2 Added handling of mono screens to all programs.
3.0 Added BCHDIR.
Added BEPSON, BIBMGRAPH, BHPLJ, BUNISYS.
Mouse usage changed to point-and-shoot.
Internal updates.
Reluctantly removed mouse support from non-registered version.
In order to get mouse support, you must register.
3.1 Fix to documentation
Restored mouse support.
4.0 Added BXQTDIR, BFILEDIR, BDIALOG, BTEXTWIN
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
WHAT'S COMING
The following items are in development for the 4.10 release.
BASK - Solicit a string response from the user and store in an
environment variable
BPOPDIR - Display a list of files in a window and place the file
selected into an environment variable.
BTEXTWIN - Read text from ASCII file and display in a window.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
THE USUAL STUFF
If you like this program, a registration of $5 would be appreciated. All
persons who register will be notified of any updates to this program and of
the availability of other programs produced by The Lone Consultant.
David K. Rich
The Lone Consultant
996 Burns Ave.
St. Paul, MN 55106
Checks must be made payable to David K. Rich.
The Lone Consultant disclaims all warranties, either express or implied,
including but not limited to any implied warranty of merchantability or
fitness for any particular purpose.
In no event will The Lone Consultant be liable for any damages whatsoever
(including without limitation damages for loss of business profits, business
interruption, loss of business information or the like) arising out of the
use of, interruption in the use of, or inability to use this software, even
if The Lone Consultant has been advised of any possibility or likelihood of
such damages.
Portions (c) Mike Smedley (CXL library for MIX PowerC).