home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 September / Simtel20_Sept92.cdr / msdos / batutl / ben250.arc / BEN.DOC next >
Text File  |  1990-01-04  |  42KB  |  946 lines

  1.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  2.           ▒                                                        ▒
  3.           ▒                                                        ▒
  4.           ▒                                                        ▒
  5.           ▒               BEN - the Batch ENhancer                 ▒
  6.           ▒               ────────────────────────                 ▒
  7.           ▒                                                        ▒
  8.           ▒           Version 2.50 (c) Simvis Soft 1990            ▒
  9.           ▒                    Author Simon Lee                    ▒
  10.           ▒                                                        ▒
  11.           ▒                                                        ▒
  12.           ▒                                                        ▒
  13.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  14.           
  15.           
  16.           This program is distributed under the Shareware scheme. You
  17.           are encouraged to give copies of this program to other
  18.           computer users. If you decide to use the program, support
  19.           the Shareware marketing concept by becoming a registered
  20.           user. Read the appendix for more details. Please read the
  21.           entire manual for your understandings of BEN. If you are
  22.           unable to do that, at least read section 2.1.
  23.           
  24.           ───────────────────────────────────────────────────────────
  25.           
  26.           1.1 What is BEN?
  27.           BEN stands for the Batch ENhancer:
  28.           
  29.           *BATCH*
  30.           Batch is a very simple yet powerful language DOS adapted.
  31.           However, it is very weak in some fields, such as the
  32.           inabilities to display color or input strings from user.
  33.           
  34.           *ENHANCER*
  35.           This program enhances the Batch language (as you know, batch
  36.           files end with the extension of .BAT)
  37.           The objective of this utility is to overcome the BATCH
  38.           weaknesses. Here is a rough list of what BEN can do:
  39.           - Sound: Music, beeps, etc.
  40.           - Boxes: growing, filled, shadowed, invisible, etc.
  41.           - Display strings: centered, vertical, etc.
  42.           - Displaying: EGA/VGA 43/50 lines mode, colors, etc.
  43.           - Sidekick Plus style directory.
  44.           - Input from user: key, line, upper cased line.
  45.           - Pause the computer for a certain period of time.
  46.           - Scrolling.
  47.           To see these features, go back to the DOS prompt and run
  48.           BENDEMO.BAT, and keep in mind that what you will see is only
  49.           a batch file.
  50.           
  51.           ───────────────────────────────────────────────────────────
  52.           
  53.           1.2 Requirements:
  54.           IBM PC/Compatible with PC/MS-DOS 2.1 or higher.
  55.           (3.3 or higher recommended. If you are using a version lower
  56.            than 3.3, whenever in this document the command "CALL" is
  57.            used, change it to "COMMAND /C".)
  58.           
  59.           Optional: ANSI.SYS or equivalent.
  60.           
  61.           (Note: ANSI is a computer standard that every user should
  62.           have. If you did not install it yet, BENDEMO.BAT will not
  63.           run properly; and the option COLORNOW is diminished.
  64.           Therefore ANSI is highly recommended. ANSI.SYS is included
  65.           with all PC/MS-DOS. If you require aid in installing, please
  66.           refer to the appendix.)
  67.           
  68.           ───────────────────────────────────────────────────────────
  69.           
  70.           2.1 Command Parameters
  71.           
  72.           Command: [d:][path]BEN.EXE [options][options...]
  73.           The first [d:][path] specifies the pathname for BEN.
  74.           You can stack as many options on one line as the environment
  75.           can hold. For example, "BEN DELAY 3000 ATTRIB 7 0" is a
  76.           command line with 2 options. Just enter options one after
  77.           another. Each option has several parameters which you will
  78.           need to pass to it. In this case, they are 3000, 7 and 0.
  79.           The above line is exactly the same as:
  80.           
  81.           BEN DELAY 3000                } 3000  are the
  82.           BEN ATTRIB 7 0                } 7, 0  parameters.
  83.           
  84.           Note: Never stack several options that uses BENBAT on a
  85.                 single line of command. They are identified with an
  86.                 asterisk (*) following on.
  87.                 Anything after the ECHO option is thought to be
  88.                 parameters, therefore never use any option after using
  89.                 ECHO on one command line.
  90.           
  91.           Options: (briefly discussed:)
  92.           
  93.           Upper case = mandatory words.
  94.           Lower case = parameters which need substitution.
  95.           [in bracket] = optional parameters.
  96.           
  97.           
  98.           (No option entered)
  99.           Just by typing BEN will provide you with few help screens.
  100.           Also, the UNREGISTERED message will only appear in this
  101.           section of BEN.
  102.           
  103.           1> ASK options <────── (Such as this. "options" is a parameter.)
  104.              This command wait for the user to press a key, and return an
  105.              errorlevel according to the key.
  106.           
  107.           2> ATTRIB fground bground
  108.              Clears the screen with the specified colors.
  109.           
  110.           3> BEEP
  111.              Creates a "beep" sound.
  112.           
  113.           4> BOX x1 y1 x2 y2 fground bground bordertype boxtype
  114.              Creates a box on the screen.
  115.           
  116.           5> COLORNOW fground bground
  117.           *  Changes the current writing color.
  118.           
  119.           6> CURSOR [ON][OFF]
  120.              Shows or hides the text cursor.
  121.           
  122.           7> DIRDISP directory return
  123.           *  Displays a SideKick Plus style directory and allows the user
  124.              to select a file or change directories.
  125.           
  126.           8> DELAY milliseconds
  127.              Delays the computer for a certain period of time.
  128.              (Note: 1 second = 1000 milliseconds.)
  129.           
  130.           9> ECHO fground bground word1 [word2...]
  131.              Writes a string onto the screen. Identical to the DOS ECHO.
  132.           
  133.           10> EGAVGA [ON][OFF]
  134.               Turns the EGA/VGA 43/50 lines mode on or off.
  135.               The presence of EGA/VGA is passed into the DOS errorlevel:
  136.               0 = No, 1 = Yes.
  137.           
  138.           11> GOTOXY x y or
  139.               GOTOXY T textfile
  140.               Goes to the certain part of the screen as specified in x and y.
  141.           
  142.           12> INLINE
  143.           *   Inputs a line of string from user.
  144.           
  145.           13> INLINEU
  146.           *   Inputs a line of string from user, and convert it to
  147.               upper case.
  148.           
  149.           14> INKEY
  150.           *   Inputs a character from the user.
  151.           
  152.           15> MENU title totalchoices choice1 [choice2...]
  153.           *   Displays a manual on the screen, and allow the user to select
  154.               a choice.
  155.           
  156.           16> SOUND frequency duration [frequency duration...] or
  157.               SOUND T textfile
  158.               This option is used to play music.
  159.           
  160.           17> SCROLL x1 y1 x2 y2 direction or
  161.               SCROLL T textfile
  162.               Scrolls text on the screen in any of the four directions.
  163.           
  164.           18> T textfile
  165.               Uses a data file to perform BEN jobs OPTIMIZED!
  166.           
  167.           19> WRITE fground bground wordcount word1 [word2...]
  168.               Displays a string onto the screen.
  169.           
  170.           20> WRITEC fground bground wordcount word1 [word2...]
  171.               Displays a centered string onto the screen.
  172.           
  173.           21> WRITEV x y fground bground wordcount word1 [word2...]
  174.               Displays a vertical column of string onto the screen.
  175.           
  176.           
  177.           * - returns from BEN is passed into BENBAT.BAT. When it is
  178.               called, the value is then passed into the environment
  179.               variable "BEN", in which the batch file can access.  For
  180.               more details about BENBAT, please refer to 2.3.
  181.           
  182.           ───────────────────────────────────────────────────────────
  183.           
  184.           2.2 In Depth - Options
  185.           (Suggestion: Spend a moment trying out the commands, or
  186.                        refer to BENDEMO.BAT.)
  187.           
  188.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  189.           
  190.           1> ASK options
  191.           This command reads a character from the keyboard similar to
  192.           INKEY, and then matches it to the string parameter
  193.           "options". If the inputted character matches to any
  194.           component in "options", the position of it in "options" is
  195.           then sent to DOS errorlevel. (For more information about
  196.           errorlevel, please refer to your DOS manual.) If the key
  197.           does not match to any character defined in "options", the
  198.           program will produce a beep, and repeat the loop until the
  199.           user press one of the right key. Example:
  200.           
  201.           ECHO Please press 1, 2, 3, 4, or X.
  202.           BEN ASK 12345X  <───── Test if user presses "1","2","3","4","5",or"X"
  203.           If errorlevel 6 goto KeyX {The 6th position in "12345X", which is X}
  204.           If errorlevel 5 goto Key5
  205.           If errorlevel 4 goto Key4
  206.           If errorlevel 3 goto Key3
  207.           If errorlevel 2 goto Key2
  208.           If errorlevel 1 goto Key1 {The 1st position in "12345X", which is 1}
  209.           :Key1
  210.           Echo 1
  211.           Goto end
  212.           :Key2
  213.           Echo 2
  214.           Goto end
  215.           :Key3
  216.           Echo 3
  217.           Goto end
  218.           :Key4
  219.           Echo 4
  220.           Goto end
  221.           :Key5
  222.           Echo 5
  223.           Goto end
  224.           :KeyX
  225.           Echo End
  226.           :End
  227.           
  228.           This example demonstrated the use of ASK. Firstly, when it
  229.           is ran from DOS as a batch file, BEN will read a key from
  230.           the user, and matches it to the string. In this case
  231.           "12345X". If the entered key is 1, 2, 3, 4, 5 or X (upper or
  232.           lower case), then the corresponding errorlevel is returned
  233.           to DOS. (1, 2, 3, 4, 5 or 6) In this example, if the user
  234.           presses X, then the errorlevel will be 6, because "X" is the
  235.           sixth character in the "options" parameter - "12345X". If the
  236.           user presses 2, then the errorlevel will be 2. If the user
  237.           presses Q (a key not defined), the program will beep and
  238.           wait for another keystroke to be processed.
  239.           
  240.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  241.           
  242.           2> ATTRIB fground bground
  243.           This command clear the entire screen with the foreground
  244.           color in the parameter fground and the background color in
  245.           the variable bground.
  246.           
  247.           (For detail on color numbers, refer to appendix)
  248.           
  249.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  250.           
  251.           3> BEEP - this command just creates a beep sound. No
  252.                     parameter is needed.
  253.           
  254.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  255.           
  256.           4> BOX x1 y1 x2 y2 fground bground bordertype boxtype
  257.           
  258.           This command is a very complex one. I will try to explain as
  259.           clearly as possible, since it's very important.
  260.           
  261.           1> It creates a box on the screen.
  262.           2> x1 and y1 are co-ordinations of the top-left corner.
  263.           3> x2 and y2 are co-ordinations of the lower-right corner.
  264.           4> Fground defines the foreground color of the box.
  265.           5> Bground defines the background color.
  266.           6> There are several border types as defined in the
  267.              parameter (bordertype):
  268.           
  269.           0 - No border.
  270.           1 - Single line border. Like this: ───
  271.           2 - Double line border. Like this: ═══
  272.           3 - Single top/bottom and double sides border.
  273.           4 - Double top/bottom and single sides.
  274.           
  275.           (Normal Box)
  276.           5 - No border. However the contents of the box is painted.
  277.               It is similar to using the attrib command. The
  278.               difference is that it does not clear the screen, and it
  279.               only paints the area designated in the variables
  280.               x1,y1,x2,y2. This function must be used together with
  281.               the normal box type. (In short, it changes the
  282.               attributes of a certain text on the screen.)
  283.           
  284.           (Filled Box and Growing Filled Box:)
  285.           5 .. 9 - Same as 1 .. 4, except with shadowing.
  286.           
  287.           (All kind of boxes)
  288.           10 .. 255 - The corresponding ASCII character as the border.
  289.           
  290.           
  291.           There are 3 box types:
  292.           N - Normal Box. (Only outline of box is colored, contents
  293.               are not.)
  294.           F - Filled Box. (The whole box is filled, including
  295.               contents. The text originally inside the box is erased.)
  296.           G - Growing Filled Box. (Same as Filled Box, except the box
  297.               "explodes" or "grows" out.)
  298.           
  299.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  300.           
  301.           5> COLORNOW fground bground
  302.           
  303.           Changes the current writing color via ANSI.SYS. (Must
  304.           install it in order to use COLORNOW.) It is called through
  305.           BENBAT.BAT, however, it doesn't set any environment
  306.           variable. It uses the ECHO command to change the current
  307.           writing color.
  308.           
  309.           Note: GOTOXY will lose its effect after calling COLORNOW.
  310.                 Remember to use GOTOXY AFTER using COLOWNOW.
  311.           
  312.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  313.           
  314.           6> CURSOR [ON][OFF]
  315.           
  316.           Use this command to make the text cursor appear or
  317.           disappear. Use CURSOR OFF to hide it, and CURSOR ON to make
  318.           it appear.
  319.           
  320.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  321.           
  322.           7> DELAY milliseconds
  323.           The computer will sleep (pause) for the certain amount of
  324.           milliseconds as defined in the parameter "milliseconds".
  325.           Note: 1 second = 1000 milliseconds.
  326.           
  327.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  328.           
  329.           8> DIRDISP directory return
  330.           
  331.           This option displays a Sidekick Plus style directory and
  332.           allows the user to select a file or change directories. The
  333.           user may use the cursor keys to move around the directories,
  334.           and use the ENTER key to choose the file. The filename
  335.           returned by the user is passed to BENBAT.BAT. For more
  336.           details concerning BENBAT, see 2.3. "Directory" defines the
  337.           directory and the files to display to the user. There are 5
  338.           "return" types available as defined in the 2nd parameter:
  339.           
  340.           "F" - Full return. (Same as "D,P,N,E" together.)
  341.                 Eg. C:\TELECOM\MODEM\MYCOMM\ABC.DOC
  342.           "D" - Only drive letter returned.
  343.                 Eg. C (Colon not included)
  344.           "P" - Only pathname returned.
  345.                 Eg. \TELECOM\MODEM\MYCOMM
  346.           "N" - Only filename returned.
  347.                 Eg. ABC
  348.           "E" - Only extension returned.
  349.                 Eg. DOC
  350.           
  351.           For example, to display the directory C:\DOC\STORY:
  352.           "BEN DIRDISP C:\DOC\STORY\*.* P" may be issued.
  353.           If the user selects a file named "C:\DOC\STORY\MY.TXT", then
  354.           "\DOC\STORY" will be passed to BENBAT.BAT. If the user
  355.           presses ESC while using this command, the string "ESC" is
  356.           passed to BENBAT.
  357.           
  358.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  359.           
  360.           9> ECHO fground bground word1 [word2...]
  361.           
  362.           This option is mainly used together with the T option of
  363.           BEN. It can write a string onto the screen, similar to the
  364.           DOS ECHO command. The only difference between this option
  365.           and the WRITE option is that this command does not need a
  366.           wordcount variable. (Please refer to the WRITE command.)
  367.           However ECHO will think that everything on the command line
  368.           after it are parameters. Therefore after using ECHO, you can
  369.           not add any more options onto the command line. The fground
  370.           and the bground parameters define the color of the text. Eg:
  371.           
  372.           BEN ECHO 7 2 Hello User! This is a great day!
  373.           
  374.           Using this command, the following text:
  375.           "Hello User! This is a great day!" will be displayed onto
  376.           the screen in a green background and a gray foreground. The
  377.           major use of ECHO is to use it with the T option. In the T
  378.           text file, you can use this command to replace the DOS ECHO
  379.           command. With this option, you can also write environment
  380.           variables onto the screen. Eg:
  381.           
  382.           BEN ECHO %Username% is a good guy.
  383.           
  384.           If %Username% is "Simon Lee", then BEN will write:
  385.           "Simon Lee is a good guy" onto the screen, without any
  386.           worries of the wordcount variable used in the WRITE command.
  387.           
  388.           Note: The drawback is you can not use any more BEN options
  389.                 after using ECHO. Eg:
  390.           
  391.           BEN ECHO Hello, this is a 7 words sentence. ATTRIB 7 1 INKEY
  392.           would display the following onto the screen:
  393.           "Hello, this is a 7 words sentence. ATTRIB 7 1 INKEY"
  394.           
  395.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  396.           
  397.           10> EGAVGA [ON][OFF]
  398.           This option tests the presence of the EGA/VGA card, and the
  399.           result is returned into the DOS errorlevel (0 = not present,
  400.           1 = present.)
  401.           
  402.           If the card is present, this option can also change the
  403.           current mode between 25 lines and 43/50 lines. The command
  404.           is "EGAVGA ON" or "EGAVGA OFF", where ON specifies the 43/50
  405.           lines mode and OFF specifies the 25 lines mode. Example:
  406.           
  407.           BEN EGAVGA ON
  408.           
  409.           will test the presence of the EGA or VGA card. If the card
  410.           is present, then the errorlevel of 1 is returned, and the
  411.           mode is changed into 43/50 lines. However, if the EGA or VGA
  412.           card is not found, the program would return an errorlevel of
  413.           0 and the line mode would not change.
  414.           (Note: EGA uses 43 lines, and VGA uses 50.)
  415.           
  416.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  417.           
  418.           11> GOTOXY x y
  419.           
  420.           Move the text cursor to certain part of the screen as
  421.           specified in x and y co-ordination parameters.
  422.           
  423.           For example, BEN GOTOXY 2 20 will go to row 20, column 2.
  424.           
  425.           GOTOXY T textfile - Read a textfile (ASCII) and perform the
  426.           functions as written in the textfile. You can write a file
  427.           using text editors such as the EDLIN supplied with DOS. The
  428.           text file format is as follows:
  429.           
  430.           FGROUND BGROUND <CR>
  431.           X Y <CR>
  432.           TEXT <CR>
  433.           X Y <CR>
  434.           TEXT <CR>
  435.           ...
  436.           X Y <CR>
  437.           TEXT <CR>
  438.           <End of File>
  439.           
  440.           The first line defines the foreground and background color
  441.           of all the texts that follows.
  442.           
  443.           Then, starting from the second line, the format is:
  444.           X Y - The column and row that GOTOXY have to jump to for the
  445.                 writing of the text.
  446.           
  447.           TEXT - The TEXT to write onto the screen immediately after
  448.                  the text cursor jumped to the position defined by X
  449.                  and Y.
  450.           
  451.           Example: TEST.DAT
  452.           
  453.           15 1 <CR>
  454.           5 5 <CR>
  455.           Hello, My name is Super Dave! <CR>
  456.           7 5 <CR>
  457.           See you later! <CR>
  458.           <End of File>
  459.           
  460.           Use BEN GOTOXY T TEST.DAT to run the data file.
  461.           
  462.           This example will use white foreground and blue background
  463.           for text writing. First, BEN will jump to column 5, row 5,
  464.           and it will write the text "Hello, My name is Super Dave!"
  465.           Then it will jump to column 7, row 5, and it will write the
  466.           text "See you later!" Please consult the BENDEMO file for
  467.           more examples.
  468.           
  469.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  470.           
  471.           12> INLINE
  472.           
  473.           Input a line of text from the user. The string is
  474.           then passed to BENBAT.BAT.
  475.           
  476.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  477.           
  478.           13> INLINEU
  479.           
  480.           Same as INLINE, except the string is filtered into an upper
  481.           case string. For example, if the user input "I am a
  482.           Canadian", "I AM A CANADIAN" would be passed to BENBAT.BAT.
  483.           
  484.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  485.           
  486.           14> INKEY
  487.           
  488.           Input a character from the user. The character is
  489.           then passed to BENBAT.BAT.
  490.           
  491.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  492.           
  493.           15> MENU title totalchoices choice1 [choice2...]
  494.           
  495.           This option is used to display a nice-looking menu centered
  496.           on the screen, allowing the batch file user to select from
  497.           up to 20 choices. "Title" defines the title name of the
  498.           menu. "Totalchoices" defines the number of choices that the
  499.           user can select. "Choice 1" defines the name of the first
  500.           choice, etc.
  501.           
  502.           The return is passed into the DOS errorlevel, it consists of
  503.           an integer, which is the corresponding choice number that
  504.           the user selected. If the user presses ESC in the menu, the
  505.           integer 0 will be returned to DOS errorlevel. (For more
  506.           information about errorlevel, please refer to your DOS
  507.           manual.)
  508.           
  509.           For example: MENU Main 3 Savefile Loadfile Quitfile:
  510.           will show a menu titled "MAIN" with 3 choices of Savefile,
  511.           Loadfile and Quitfile.
  512.           
  513.           If the user selects Loadfile, an errorlevel of 2 will be
  514.           returned.
  515.           
  516.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  517.           
  518.           16> SOUND frequency duration [frequency duration...] or
  519.               SOUND T textfile
  520.           
  521.           This command plays a piece of music as defined by the batch
  522.           file writer. The frequency variable defines the frequency of
  523.           sound to play, and the duration defines the duration of this
  524.           sound in milliseconds. For example SOUND 300 300 400 300
  525.           would create two different sounds the same duration, with
  526.           the second one a bit higher than the first. Computers with
  527.           different speed would sound differently.
  528.           
  529.           The second way of playing music is through a text file in
  530.           ASCII format. This file is named in the variable "textfile"
  531.           and would be played when this command is issued. For
  532.           example, to play a textfile called YANKEE.MUS, you issue the
  533.           command: BEN SOUND T YANKEE.MUS.
  534.           
  535.           You can create this ASCII file with any text editor, such as
  536.           EDLIN supplied with DOS. The structure of this ASCII file is
  537.           as followings:
  538.           
  539.           FREQUENCY DURATION <CR>
  540.           FREQUENCY DURATION <CR>
  541.           FREQUENCY DURATION <CR>
  542.           ...
  543.           FREQUENCY DURATION <CR>
  544.           <End of File>
  545.           
  546.           Each line of the ASCII file defines 2 numbers, whereas the
  547.           first is the frequency and the second is the duration.
  548.           
  549.           (Note to user: Do not use a frequency or duration lower than
  550.            0 with the SOUND command, or the system would crash. To make
  551.            a pause in a music piece, give the frequency of 0, which
  552.            will tell the computer not to play any sound for the time
  553.            period as defined in DURATION.)
  554.           
  555.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  556.           
  557.           17> SCROLL x1 y1 x2 y2 direction or
  558.               SCROLL T textfile
  559.           
  560.           This command scrolls text on the screen in any of the four
  561.           directions: "UP", "DOWN", "LEFT" and "RIGHT".
  562.           
  563.           a) x1 and y1 are coordinates of the top left corner of the
  564.              region to be scrolled.
  565.           b) x2 and y2 are coordinates of the bottom right corner.
  566.           c) The variable DIRECTION defines the direction in which the
  567.              block will move: UP, DOWN, LEFT, RIGHT.
  568.           
  569.           The area which the block moves away from is replaced by a
  570.           blank line.
  571.           
  572.           For example: "BEN SCROLL 3 3 40 20 Up" will scroll the text in
  573.           the block between 3,3 and 40,20 up one position. The second
  574.           way of using SCROLL, which is more efficiently, is to use a
  575.           text file. (Defined in the parameter TEXTFILE.) The text file
  576.           is an ASCII file which can be created by text editors such
  577.           as DOS's EDLIN. The format of the text file is as follows:
  578.           
  579.           PAUSE IN MILLISECOND
  580.           X1, Y1, X2, Y2, DIRECTION <CR>
  581.           X1, Y1, X2, Y2, DIRECTION <CR>
  582.           X1, Y1, X2, Y2, DIRECTION <CR>
  583.           ...
  584.           X1, Y1, X2, Y2, DIRECTION <CR>
  585.           <End of File>
  586.           
  587.           The first line of this text file will declare the pause in
  588.           milliseconds between each line of scrolling command. The
  589.           rest of the file have command lines that are the same with
  590.           the normal use of SCROLL. Suppose the file is called
  591.           BENDATA.DTA, then issuing BEN SCROLL T BENDATA.DTA will
  592.           perform the functions declared in the text file. Consult
  593.           BENDEMO.BAT for more examples.
  594.           
  595.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  596.           
  597.           17> T textfile
  598.           
  599.           This option is the most important new option presented in
  600.           BEN 2.50. It can read a normal text file, (ASCII format
  601.           which can be created with any text editor, such as EDLIN
  602.           which is bundled with DOS.) and perform the options in it.
  603.           
  604.           This allows a much quicker operation of BEN, making it
  605.           unnecessary to reload BEN over and over again. The format of
  606.           the text file is as follows:
  607.           
  608.           OPTIONS
  609.           OPTIONS
  610.           OPTIONS
  611.           ...
  612.           OPTIONS
  613.           <End of File>
  614.           
  615.           The OPTIONS are exactly the same as the options called directly
  616.           from the batch file. For example:
  617.           
  618.           BEN BOX 1 1 80 25 7 1 1 G INKEY
  619.           BEN CURSOR OFF ATTRIB 7 0
  620.           
  621.           is exactly the same as
  622.           
  623.           BEN T DATA.DAT
  624.           
  625.           where DATA.DAT contains:
  626.           
  627.           BOX 1 1 80 25 7 1 1 G INKEY
  628.           CURSOR OFF
  629.           ATTRIB 7 0
  630.           <End of File>
  631.           
  632.           Please consult BENDEMO.BAT for some more examples.
  633.           
  634.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  635.           
  636.           18> WRITE fground bground wordcount word1 [word2...]
  637.           
  638.           This function replace the ECHO command of DOS, thus BEN runs
  639.           faster without reloading itself again if other options are
  640.           ran in conjunction. It also adds color to prompts which DOS
  641.           ECHO can not do. The fground and bground parameters defines
  642.           the color of the string to write. wordcount defines the
  643.           number of words in the string. Word1 will be the first word,
  644.           etc. EXAMPLE:
  645.           
  646.           BEN COLORNOW 7 1
  647.           CALL BENBAT
  648.           BEN GOTOXY 5 5
  649.           ECHO Hello, this is Super Dave again.
  650.           
  651.           can be replaced into just one line with WRITE:
  652.           
  653.           BEN GOTOXY 5 5 WRITE 7 1 6 Hello, this is Super Dave again.
  654.           
  655.           WRITE is a very good alternative to ECHO, however it still
  656.           has some inabilities, such as unabling to write more than one
  657.           space between two words. Example:
  658.           To write "Hello,   I am a good man." onto the screen, you
  659.           must use ECHO like this: "ECHO Hello,   I am a good man."
  660.           
  661.           If you use BEN, it doesn't work:
  662.           "BEN WRITE 7 0 6 Hello,   I am a good man" will produces
  663.           "Hello, I am a good man." on the screen.
  664.           
  665.           (Note: This can be fixed if you use ASCII NUL character.
  666.            Please read 3.1 for hints and tips.)
  667.           
  668.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  669.           
  670.           19> WRITEC fground bground wordcount word1 [word2...]
  671.           
  672.           Same as WRITE, except the string is centered nicely on the
  673.           screen. For example:
  674.           
  675.           BEN WRITEC 7 0 4 Hello Ladies and Gentlemen!
  676.           
  677.           will place the string "Hello Ladies and Gentleman" on the
  678.           screen, centered, and in gray foreground and black
  679.           background.
  680.           
  681.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  682.           
  683.           20> WRITEV x y fground bground wordcount word1 [word2...]
  684.           
  685.           This option put a vertical column of text onto the screen. X
  686.           and Y are the coordinates of the top character. F and B are
  687.           the foreground and background display colors. Wordcount is
  688.           the number of words present and word1, word2, etc. are the
  689.           words to display. Eg.
  690.           
  691.           BEN WRITEV 1 1 7 2 3 Hello User! Hello!
  692.           
  693.           will write a vertical column of text "Hello User! Hello!"
  694.           onto the screen at the top-left corner of the screen, in a
  695.           green background and a gray foreground.
  696.           
  697.           ───────────────────────────────────────────────────────────
  698.           
  699.           2.3 BENBAT.BAT
  700.           
  701.           The value returned from COLORNOW, DIRDISP, INLINE, INLINEU
  702.           and INKEY will be passed into a file named BENBAT.BAT. When
  703.           BENBAT.BAT is "call"ed from your batch file, the value will be
  704.           passed onto the environment variable "BEN", therefore the
  705.           batch file can process that information. (Note: Screen
  706.           information returned from COLORNOW is different. It does not
  707.           call the environment variable, however it calls ANSI.SYS.)
  708.           (For more information about environment variable, please
  709.           consult your DOS menu.) For example, a batch file like this:
  710.           
  711.           @Echo off
  712.           BEN ATTRIB 15 1
  713.           Echo Please enter your name.
  714.           BEN INLINE
  715.           Call BENBAT  <─────── (Pass what the user type into %BEN%)
  716.           :REM Change "CALL" to "COMMAND /C" if
  717.           :REM your DOS version is lower than 3.3.
  718.           Echo %BEN% is the best. (Use the env't variable %BEN%)
  719.           Del BENBAT.BAT
  720.           
  721.           This file will clear the screen with a blue background and a
  722.           white foreground. The batch file then will ask you for your
  723.           name. For example, use Daniel. Afterwards, the batch file
  724.           will respond with "Daniel is the best". One final note,
  725.           remember to delete BENBAT.BAT when you finish the batch
  726.           file.
  727.           
  728.           ───────────────────────────────────────────────────────────
  729.           
  730.           3.0 I still do not understand how to use BEN, what do I do?
  731.           Try to play with the commands with BEN for a while, then you
  732.           will get it. Also, examine our supplied sample batch file.
  733.           The best way to learn it is to print this document, and
  734.           follow the instructions in the document while trying out on
  735.           the computer.
  736.           
  737.           ───────────────────────────────────────────────────────────
  738.           
  739.           3.1 Hints and Tips:
  740.           - If you run out of environment space to store items
  741.             returned from BEN, put the following command at the start
  742.             of the batch file:
  743.           
  744.             PATH > $RMBRTMP.BAT
  745.             PATH;
  746.           
  747.             and put the following at the end of the batch file:
  748.           
  749.             CALL $RMBRTMP
  750.             DEL $RMBRTMP.BAT
  751.           
  752.           - Another way is to increase your environment space by using
  753.             the SHELL command of DOS. Please consult your DOS manual.
  754.           
  755.           - If you use the BOX command, you can create good-looking
  756.             borders also by specifying an ASCII number (5+) in the
  757.             variable "bordertype". For example:
  758.             BEN BOX 1 1 80 25 7 0 251 N will create a box around the
  759.             screen with a border made up of "√".
  760.           
  761.           - Using WRITE, or MENU, you can create hard-spaces between
  762.             words using the NUL character, ASCII 255. This character
  763.             is created by depressing ALT, and tapping the numeric
  764.             keyboard "2" "5" and "5". When BEN sees NUL, it will think
  765.             that this space character is a normal character. For
  766.             example you can use this command without error:
  767.           
  768.             BEN WRITE 7 1 1 HELLO I AM THE BEST!
  769.              specify ─────┘      ^    ^   ^
  770.               1 word.    These are NULs instead of spaces.
  771.           
  772.             Look at the demo batch file for more example.
  773.           
  774.           - Using a disk optimizer on your disk containing BEN will
  775.             speed up the operation of BEN up to 200%.
  776.           
  777.           ──────────────────────────────────────────────────────────
  778.           
  779.           4.0 Bugs report, comments, problems...
  780.           
  781.           If you feel that this manual is inadequate, or uncover any
  782.           bugs or problems,  please mail a letter to me concerning
  783.           that matter to:
  784.           
  785.           Simon Lee,
  786.           301 Holmes Ave.,
  787.           Willowdale, Toronto,
  788.           Ontatio, Canada.
  789.           
  790.           Comments are extremely welcome.
  791.           
  792.           ───────────────────────────────────────────────────────────
  793.           
  794.           History of BEN.EXE:
  795.           
  796.           Version 2.50 as of 01/04/90:
  797.           - Speeded up internal processing.
  798.           - Added four new commands: ECHO, EGAVGA, T, WRITEV.
  799.           - Allows the use of a text file for all the BEN commands.
  800.           - Document changed to the new SIMVIS format. Clearly
  801.             re-editted.
  802.           - HISTORY.DOC integrated into BEN.DOC.
  803.           
  804.           Version 2.20 as of 10/28/89:
  805.           - Added three new commands: CURSOR, SCROLL and WRITEC.
  806.           - Enhanced BENDEMO.BAT. (Although added two data files.)
  807.           - Fixed a bug in BOXING AROUND in BENDEMO.BAT.
  808.           
  809.           Version 2.10 as of 10/21/89:
  810.           - Added a new command: ASK.
  811.           - Improved MENU command, unnecessary to call BENBAT anymore.
  812.           - Better HISTORY.COM.
  813.           - Blinking "Unregistered Version" when typing "BEN" alone.
  814.           - Added the $19 registration option.
  815.           - Added new features in BENDEMO.BAT.
  816.           
  817.           Version 2.00b as of 10/16/89:
  818.           - Fixed a minor bug in BENDEMO.BAT.
  819.           - Fixed a minor bug in HISTORY.DOC.
  820.           - Fixed documentation.
  821.           - Added ORDERFRM.TXT with BEN.
  822.           
  823.           Version 2.00a as of 10/15/89:
  824.           - Fixed two bugs in BENDEMO.BAT
  825.           
  826.           Version 2.00 as of 10/15/89:
  827.           - Splitted one big Turbo Pascal program into a program and a unit.
  828.           - Program run faster.
  829.           - New commands: COLORNOW, DELAY, GOTOXY, SOUND and WRITE.
  830.           - Improved DIRDISP command, allow extraction of a certain part of
  831.             a full path name.
  832.           - Demo batch file added.
  833.           - Better documentation.
  834.           
  835.           Version 1.00 as of 10/11/89:
  836.           - First release of BEN.EXE.
  837.           
  838.           Preview of next version:
  839.           - Add the batch editor as suggested by Jay Norwalk.
  840.           - More capability of the use of ANSI.SYS.
  841.           - Speedier BEN.
  842.           
  843.           ───────────────────────────────────────────────────────────
  844.           
  845.           Acknowledgments: CompuSoft Lab (Erik and Edwin Lee).
  846.                            Jay Norwalk
  847.           
  848.           ───────────────────────────────────────────────────────────
  849.           
  850.           Trademarks:
  851.           IBM and PC-DOS are trademarks of Internation Business
  852.           Machines Corporation. FASTBACK is trademark of Fifth
  853.           Generation Software. MS-DOS and EDLIN are trademarks of
  854.           Microsoft Corporation. STRIGGER, SIM-RMD, BEN and MAGIK MENU
  855.           are trademarks of SIMVIS SOFT.
  856.           
  857.           ───────────────────────────────────────────────────────────
  858.           
  859.           Disclaimer:
  860.           Use of this program acknowledges this disclaimer of
  861.           warranty: "This program is supplied as is. SIMVIS SOFT
  862.           disclaims all warranties, expressed or implied, including,
  863.           without limitation, the warranties of merchantability and of
  864.           fitness of this program for any purpose. SIMVIS SOFT assumes
  865.           no liability for damages directly or consequential, which
  866.           may result from the use of this program."
  867.           
  868.           ───────────────────────────────────────────────────────────
  869.           
  870.           Appendix:
  871.           
  872.           Installing ANSI.SYS which comes with DOS
  873.           ----------------------------------------
  874.           
  875.           1> Find ANSI.SYS from your DOS distribution disk and put it
  876.              in the directory you want.
  877.           2> Add the following line to CONFIG.SYS by using this
  878.              commands:
  879.           
  880.           C> COPY CONFIG.SYS+CON CONFIG.SYS
  881.           CONFIG.SYS
  882.           CON
  883.           DEVICE=C:\ANSI.SYS
  884.           ^Z
  885.           
  886.           That's all! For the device line, change C:\ANSI.SYS to the
  887.           directory you put ANSI.SYS in. ^Z is done by pressing
  888.           CTRL-Z.
  889.           
  890.           Color number
  891.           ------------
  892.           
  893.           0 - black                  8 - black
  894.           1 - blue                   9 - light blue
  895.           2 - green                 10 - light green
  896.           3 - cyan                  11 - light cyan
  897.           4 - red                   12 - light red
  898.           5 - purple                14 - light purple
  899.           6 - magenta               13 - yellow
  900.           7 - lightgray             15 - white
  901.           
  902.           
  903.           Registration
  904.           ------------
  905.           You are granted a limited license in the trial of this
  906.           software for thirty days for no obligations. After thirty
  907.           days, you must register in order to continue to use the
  908.           program. There are two kinds of Registration:
  909.           
  910.           1) STRIGGER, SIM-RMD and BEN for $34
  911.             Registration will provide you with:
  912.           - The newest version of BEN.
  913.           - A printed manual.
  914.           - Your name cypted into the program BEN.EXE.
  915.           - You may distribute registered versions. (With your name).
  916.           - Bundled with the newest version of BEN and SIM-RMD,
  917.             which also have your name crypted into them, including
  918.             their printed manual.
  919.           - Two free upgrades of all three programs. Disks only.
  920.           - Unlimited use of all three programs.
  921.           - License to distribute STRIGGER, SIM-RMD or BEN together
  922.             with any of your programs in an unmodified form.
  923.           - (Totally nine programs on three or more disks.)
  924.           
  925.           2) BEN only for $19
  926.             Registration will provide you with:
  927.           - The newest version of BEN.
  928.           - Printed manual.
  929.           - Your name cypted into the program BEN.EXE.
  930.           - You may distribute your registered version. (With your
  931.             name)
  932.           - A free upgrades of BEN. Disk only.
  933.           - Unlimited use of BEN.
  934.           - License to distribute BEN together with any of your
  935.             programs in an unmodified form.
  936.           
  937.             For only $34 dollars, or $19 now (US funds if ordered in
  938.             US. US or Canadian funds if ordered in Canada), you will
  939.             be a registered user. Just send a cheque, together with
  940.             the orderform (ORDERFRM.TXT) to:
  941.           
  942.           SIMON LEE,
  943.           301 Holmes Avenue,
  944.           Willowdale, Toronto,
  945.           Ontario, Canada.
  946.