home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / games / batwin40.zip / BATWIN.DOC next >
Text File  |  1989-05-01  |  19KB  |  500 lines

  1.  
  2. BATWIN 4.0
  3.  
  4. This is a collection of processors which can be called from BAT files to
  5. interface with the user.  I created them for two purposes:
  6.  
  7.           1) To make fancy BAT files
  8.  
  9.           2) Many "menu"-type programs available don't allow much
  10.              interaction with the user to select parameters, etc for the
  11.              batch stream associated with a menu selection.  These
  12.              processors, when placed in the batch streams, can solve that
  13.              lack.
  14.  
  15. Execute DEMO.BAT for a brief demonstration of the processors.
  16.  
  17.  
  18.  
  19. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  20.  
  21. BMSGWIN - Display a message in a "window" box
  22.  
  23.    Call: BMSGWIN row col attribute "string"
  24.  
  25.            row        - row on which string is written (0-22)
  26.            col        - column for first character of string (0-79)
  27.            attribute  - color of string display (see below)
  28.            "string"   - string to display, must be in quotes
  29.  
  30.        NOTE: The box will appear on the rows above and below the string.
  31.              The width of the box depends on the length of the string.
  32.  
  33. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  34.  
  35. BPOPLIST - Display a list of items in a window and let user make a choice,.
  36.            supports the mouse.
  37.  
  38.    Call: BPOPLIST ulrow ulcol height attribute file
  39.  
  40.             ulrow     - row in which upper border of box appears
  41.                         (0-(23-height))
  42.             ulcol     - column for upper left corner of box border
  43.                         (0-(79-width))
  44.             height    - inside dimension, height of box
  45.             attribute - color of display (see below)
  46.             file      - ASCII file containing choices
  47.  
  48.    The ASCII file has the following format:
  49.  
  50.             lines:  Strings to appear as choices
  51.                     First string is choice #1, next is choice #2, etc.
  52.  
  53.            Example:
  54.                       EPSON
  55.                       IBM GRAPHICS
  56.                       HP LASERJET
  57.  
  58.  
  59.    The items will be displayed in the window. If there are more items than
  60.    the height specified, the window will scroll.  If there are fewer items
  61.    than the height specified, the window will be shorter.  The width of the
  62.    window is determined by the longest item or title length.
  63.  
  64.    The mouse may be used to select items by placing the mouse cursor on the
  65.    item and clicking the left button.  The items may be scrolled by clicking
  66.    on the arrows on the right border.  Pressing the right button is the same
  67.    as pressing ESC.
  68.  
  69.    The users choice is returned in ERRORLEVEL.  If ERRORLEVEL = 127, ESC was
  70.    pressed; if it = 99, an error occurred.
  71.  
  72.    Pressing F1 displays help if in non-mouse mode.
  73.  
  74.  
  75. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  76.  
  77. BWARN - Display a warning box , supports the mouse
  78.  
  79.    Calls:
  80.               BWARN ulrow ulcol attribute title "string1" "string2"
  81.  
  82.             ulrow     - row in which upper border of box appears (0-16)
  83.             ulcol     - column for upper left corner of box border
  84.                         (0-(79-width))
  85.             attribute - color of display (see below)
  86.             title     - Blinks on top border ex. WARNING
  87.             "string1" - First explanation string in window (optional)
  88.             "string2" - Second explanation string in window (optional)
  89.                If no strings given, a default " Choose Action " is
  90.                displayed.
  91.  
  92.                    ┌────── TITLE ─────┐
  93.                    │     <string1>    │
  94.                    │     <string2>    │
  95.                    │                  │
  96.                    │ CONTINUE  ABORT  │
  97.                    │                  │
  98.                    └──────────────────┘
  99.  
  100.     Either CONTINUE or ABORT will be highlighted.  The user can select one
  101.     or the other by:
  102.  
  103.           - Pressing C or A and then RETURN
  104.  
  105.           - Pressing the right and left arrows and the RETURN
  106.  
  107.           - Pressing the SPACEBAR or TAB to toggle back and forth and then
  108.             pressing RETURN
  109.  
  110.           - Move the mouse right and left and then press the left button.
  111.  
  112.     Returns:
  113.           - 0 if user selected CONTINUE
  114.           - 1 if user selected ABORT, presssed ESC or the right mouse button
  115.  
  116.     Pressing F1 displays help.
  117.  
  118.  
  119. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  120.  
  121. BDIALOG - Display a dialog box , supports the mouse
  122.  
  123.    Calls:
  124.               BDIALOG ulrow ulcol attribute title "string1" "string2"
  125.  
  126.             ulrow     - row in which upper border of box appears (0-16)
  127.             ulcol     - column for upper left corner of box border
  128.                         (0-(79-width))
  129.             attribute - color of display (see below)
  130.             title     - Blinks on top border ex. WARNING
  131.             "string1" - First explanation string in window (optional)
  132.             "string2" - Second explanation string in window (optional)
  133.                If no strings given, a default " Choose Action " is
  134.                displayed.
  135.  
  136.                    ┌────── TITLE ─────┐
  137.                    │     <string1>    │
  138.                    │     <string2>    │
  139.                    │                  │
  140.                    │ YES  NO  CANCEL  │
  141.                    │                  │
  142.                    └──────────────────┘
  143.  
  144.     Either YES, NO or CANCEL will be highlighted.  The user can select one
  145.     or the other by:
  146.  
  147.           - Pressing Y, N or C and then RETURN
  148.  
  149.           - Pressing the right and left arrows and the RETURN
  150.  
  151.           - Pressing the SPACEBAR or TAB and then pressing RETURN
  152.  
  153.           - Move the mouse right and left and then press the left button.
  154.  
  155.     Returns:
  156.           - 0 if user selected YES
  157.           - 1 if user selected NO
  158.           - 2 if user select CANCEL or presssed ESC or the right mouse button
  159.  
  160.     Pressing F1 displays help.
  161.  
  162.  
  163. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  164.  
  165. BPAUSE - Put up message and wait for keystroke
  166.  
  167.    Call: BPAUSE row col attribute "string"
  168.  
  169.             ulrow     - row in which upper border of box appears (0-21)
  170.             ulcol     - column for upper left corner of box border (0-nn)
  171.            attribute  - color of string display (see below)
  172.            "string"   - string to display, must be in quotes
  173.                         This is optional; if not given, the message
  174.                          " Press any key to continue "
  175.                         will be displayed.
  176.  
  177.        NOTE: The width of the box depends on the length of the string.
  178.  
  179.     The box can be moved around the screen using the cursor keys or mouse.
  180.     Any other keypress terminates the program, closing the window and returning
  181.     the ASCII code for the keypress in Errorlevel; Function keys, etc return
  182.     a 0 in Errorlevel.
  183.  
  184.     If a mouse is used, the right button returns 27 and the left button
  185.     returns 13.
  186.  
  187. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  188.  
  189. BCHDIR - Change directory using point-and-shoot, supports the mouse.
  190.  
  191.     Call: BCHDIR ulrow ulcol attrib
  192.  
  193.             ulrow     - row in which upper border of box appears (0-20)
  194.             ulcol     - column for upper left corner of box border (0-nn)
  195.             attrib    - color of string display (see below)
  196.  
  197.      BCHDIR pops up a window showing the subdirectories available from the
  198.      current subdirectory, as well as the ".." directory.  The user can move
  199.      the highlight bar to a displayed directory. If RETURN is pressed that
  200.      directory is displayed, etc.  If ESC is pressed, the working directory
  201.      is changed to the displayed directory and BCHDIR exits.
  202.  
  203.      If a mouse is used, a directory can be selected by moving the mouse
  204.      cursor over it and clicking the left button.  Clicking the right button
  205.      selects the current directory.
  206.  
  207.    Pressing F1 displays help.
  208.  
  209.  
  210. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  211.  
  212. BEPSON, BIBMGR, BHPLJ, BUNISYS - Select and send control strings to printer
  213.  
  214.      Calls: BEPSON ulrow ulcol attrib          (EPSON printers)
  215.             BIBMG  ulrow ulcol attrib          (IBM Graphics printers)
  216.             BHPLJ ulrow ulcol attrib           (HP Laserjet printers)
  217.             BUNISYS ulrow ulcol attrib         (UNISYS Model 37 laser printer)
  218.  
  219.             Maximum values:      ulrow        ulcol
  220.                                  -----        -----
  221.              BEPSON, BIBMG        17           66
  222.              BHPLJ                17           64
  223.              BUNISYS              10           64
  224.  
  225.      These programs pop up a window which describes the common control
  226.      strings which might be sent to the printer.  The user selects the
  227.      desired function and presses RETURN; the control string is sent to the
  228.      printer and the program exits.  If the user presses ESC, the program
  229.      exits without sending a string.
  230.  
  231.      Mouse is supported in the same manner as BPOPLIST; the left button
  232.      selects the string under the mouse cursor, the right button exits
  233.      without sending a string.
  234.  
  235.  
  236. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  237.  
  238. BWINDOW - Draw a box ("window") on the screen
  239.  
  240.   Call:   BWINDOW ulrow ulcol height width attribute
  241.  
  242.             ulrow     - row in which upper border of box appears (0-20)
  243.             ulcol     - column for upper left corner of box border (0-79)
  244.             height    - inside dimension, height of box
  245.             width     - inside dimension, width of box
  246.             attribute - color of display (see below)
  247.  
  248.  
  249. BPUTS - Write a string on the screen
  250.  
  251.   Call: BPUTS row col attribute "string"
  252.  
  253.            row        - row on which string is written (0-23)
  254.            col        - column for first character of string (0-79)
  255.            attribute  - color of string display (see below)
  256.            "string"   - string to display, must be in quotes
  257.  
  258. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  259.  
  260. BTEXTWIN - Display a popup text window
  261.  
  262.    Call:  BTEXTWIN ulrow ulcol attribute txtfile
  263.  
  264.  
  265.             ulrow     - row in which upper border of box appears (0-20)
  266.             ulcol     - column for upper left corner of box border (0-79)
  267.             attribute - color of display (see below)
  268.             txtfile   - ASCII text file contains text for window
  269.  
  270.    Displays a pop-up window on the screen.  The window height is determined
  271.    by the number of lines in the file, the width by the length of the
  272.    longest line in the file.
  273.  
  274.    The window will remain on the screen until a key is pressed or 10 seconds
  275.    expires.  In either case, it will disappear.
  276.  
  277.            Error codes:  0 = Time expired, or function key pressed
  278.                         99 = Error, no enough parameters, window won't fit
  279.                              etc.
  280.                      other = ASCII code of key pressed (see bpause)
  281.  
  282. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  283.  
  284. BLOCATE - Locate cursor on screen
  285.  
  286.     Call: BLOCATE row col
  287.  
  288.              row    - row on which to locate cursor (0-23)
  289.              col    - column in row (0-79)
  290.  
  291. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  292.  
  293. BSAVESCR - Save screen contents to a file
  294.  
  295.     Call: BSAVESCR file
  296.  
  297.  
  298. BRESTSCR - Restore screen contents from file created by BSAVESCR
  299.  
  300.    Call:  BRESTSCR file
  301.  
  302.      Note: Cursor must be repositioned.
  303.  
  304. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  305.  
  306. BXQTDIR - Change current subdirectory to the subdirectory containing BXQTDIR
  307.  
  308.    Call: BXQTDIR
  309.  
  310.        Place BXQTDIR in a subdirectory which is in the PATH.  Whenever, it
  311.        is executed it changes the current directory to directory in which it
  312.        resides.  This would be useful if the BAT file needed to CHDIR to the
  313.        directory containing something, but you either didn't know what that
  314.        directory would be or various computers used different directories.
  315.        If you use BXQTDIR in conjunction with PUSHDIR and POPDIR , which can
  316.        usually be found on BBSs, you could
  317.  
  318.                   PUSHDIR                   ; save current subdir
  319.                   BXQTDIR                   ; change dir
  320.                   POPDIR                    ; restore previous subdir
  321.  
  322. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  323.  
  324. BFILEDIR - Change current subdirectory to the subdirectory in which the
  325.            named file exists
  326.  
  327.      Call: BFILEDIR  file.ext
  328.  
  329.         BFILEDIR searches for "file.ext", first in all directories in the
  330.         PATH and then, if unsuccessful, it scans all directories on the
  331.         current drive (or another drive, if indicated).  When "file.ext" is
  332.         found, BFILEDIR does a CHDIR to the subdirectory containing
  333.         "file.ext".
  334.  
  335.         This could also be used with PUSHDIR/POPDIR (note, however, that
  336.         these programs don't handle change of drive).
  337.  
  338.         ERRORLEVEL codes returned:       0 = Success, directory changed
  339.                                         40 = Failure, couldn't find file,
  340.                                              directory unchanged
  341.                                         99 = Error, no file.ext given
  342.  
  343. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  344.  
  345. MOUSE:
  346.  
  347.    Many of the programs support a mouse, if present.  The mouse movements
  348.    are translated into cursor keys in some programs while others use the
  349.    mouse cursor (see above). The left button is treated as ENTER, and
  350.    the right button is treated as ESC.
  351.  
  352.    BPOPLIST, BCHDIR and the printer menus use the "mouse cursor" to select
  353.    items.
  354.  
  355.  
  356. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  357.  
  358. ERROR CODES:
  359.  
  360.   All processors return a value in ERRORLEVEL.
  361.  
  362.            0   - Normal completion, no error (except BPOPLIST)
  363.            99  - Error termination
  364.                     Either not enough parameters or window too tall.
  365.  
  366.   The BPOPLIST program returns the number of the selection in errorlevel, or
  367.   it returns 127 if ESC was pressed.
  368.  
  369.   BWARN returns 0 if CONTINUE was selected, 1 if ABORT was selected or ESC
  370.   was pressed, 99 if an error occurred.
  371.  
  372.  
  373.  
  374.  
  375. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  376.  
  377. ATTRIBUTES:
  378.  
  379.    All of the programs require a color attribute to be specified.  The chart
  380.    below can be used to compute this value.  The formula is as follows:
  381.  
  382.              (bg*16)+fg+extra    (extra = value for BLINK)
  383.  
  384.  
  385.        Background                      Foreground
  386.        ----------                      ----------
  387.  
  388.             0           BLACK               0
  389.             1           BLUE                1
  390.             2           GREEN               2
  391.             3           CYAN                3
  392.             4           RED                 4
  393.             5           MAGENTA             5
  394.             6           BROWN               6
  395.             7           Lt. Grey            7
  396.                         Dark Grey           8
  397.                         Lt. Blue            9
  398.                         Lt. Green          10
  399.                         Lt. Cyan           11
  400.                         Lt. Red            12
  401.                         Lt. Magenta        13
  402.                         YELLOW             14
  403.                         WHITE              15
  404.  
  405.        Add 128 for BLINK
  406.  
  407.  
  408. MONOCHROME ADAPTERS:
  409.  
  410.         It has come to my attention that specifying colors when running on a
  411.         monochrome or Hercules monitor causes problems in BPOPLIST and
  412.         BWARN; the highlight bar is not visible.  To solve this, BPOPLIST
  413.         and BWARN now check for monochrome, Hercules and Hercules Plus
  414.         adapters and set color to white on black, regardless of the
  415.         specification on the call line. However, this still leaves the
  416.         problem of a monochrome monitor driven by a CGA board.  In order to
  417.         solve this problem, BPOPLIST and BWARN test the environment for
  418.         BATCOLOR=MONO; if found, color is set to white on black.  To set
  419.         this up, enter
  420.  
  421.                    SET BATCOLOR=MONO
  422.  
  423.         in DOS or from a BAT file (such as AUTOEXEC.BAT).  If you have
  424.         troubles with running out of environment space, see the description
  425.         of the CONFIG.SYS SHELL command in your DOS documentation.
  426.  
  427.  
  428.  
  429.  
  430. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  431.  
  432. HISTORY:
  433.  
  434.      1.0  First release.
  435.  
  436.      1.1  Same as first release, except missing POPTEST.TXT included.
  437.  
  438.      2.0  Added BPAUSE.
  439.  
  440.      2.1  Added handling of mono screens to BPOPLIST and BWARN.
  441.  
  442.      2.2  Added handling of mono screens to all programs.
  443.  
  444.      3.0  Added BCHDIR.
  445.           Added BEPSON, BIBMGRAPH, BHPLJ, BUNISYS.
  446.           Mouse usage changed to point-and-shoot.
  447.           Internal updates.
  448.           Reluctantly removed mouse support from non-registered version.
  449.               In order to get mouse support, you must register.
  450.  
  451.      3.1  Fix to documentation
  452.           Restored mouse support.
  453.  
  454.      4.0  Added BXQTDIR, BFILEDIR, BDIALOG, BTEXTWIN
  455.  
  456. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  457.  
  458. WHAT'S COMING
  459.  
  460. The following items are in development for the 4.10 release.
  461.  
  462.        BASK    - Solicit a string response from the user and store in an
  463.                  environment variable
  464.  
  465.        BPOPDIR - Display a list of files in a window and place the file
  466.                  selected into an environment variable.
  467.  
  468.        BTEXTWIN - Read text from ASCII file and display in a window.
  469.  
  470.  
  471.  
  472. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  473.  
  474. THE USUAL STUFF
  475.  
  476. If you like this program, a registration of $5 would be appreciated.  All
  477. persons who register will be notified of any updates to this program and of
  478. the availability of other programs produced by The Lone Consultant.
  479.  
  480.                         David K. Rich
  481.                         The Lone Consultant
  482.                         996 Burns Ave.
  483.                         St. Paul, MN  55106
  484.  
  485. Checks must be made payable to David K. Rich.
  486.  
  487. The Lone Consultant disclaims all warranties, either express or implied, 
  488. including but not limited to any implied warranty of merchantability or 
  489. fitness for any particular purpose.
  490.  
  491. In no event will The Lone Consultant be liable for any damages whatsoever 
  492. (including without limitation damages for loss of business profits, business 
  493. interruption, loss of business information or the like) arising out of the 
  494. use of, interruption in the use of, or inability to use this software, even 
  495. if The Lone Consultant has been advised of any possibility or likelihood of 
  496. such damages.
  497.  
  498. Portions (c) Mike Smedley (CXL library for MIX PowerC).
  499.  
  500.