home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 December
/
simtel1292_SIMTEL_1292_Walnut_Creek.iso
/
msdos
/
batutl
/
ben250.arc
/
BEN.DOC
next >
Wrap
Text File
|
1990-01-04
|
42KB
|
946 lines
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒ ▒
▒ ▒
▒ ▒
▒ BEN - the Batch ENhancer ▒
▒ ──────────────────────── ▒
▒ ▒
▒ Version 2.50 (c) Simvis Soft 1990 ▒
▒ Author Simon Lee ▒
▒ ▒
▒ ▒
▒ ▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
This program is distributed under the Shareware scheme. You
are encouraged to give copies of this program to other
computer users. If you decide to use the program, support
the Shareware marketing concept by becoming a registered
user. Read the appendix for more details. Please read the
entire manual for your understandings of BEN. If you are
unable to do that, at least read section 2.1.
───────────────────────────────────────────────────────────
1.1 What is BEN?
BEN stands for the Batch ENhancer:
*BATCH*
Batch is a very simple yet powerful language DOS adapted.
However, it is very weak in some fields, such as the
inabilities to display color or input strings from user.
*ENHANCER*
This program enhances the Batch language (as you know, batch
files end with the extension of .BAT)
The objective of this utility is to overcome the BATCH
weaknesses. Here is a rough list of what BEN can do:
- Sound: Music, beeps, etc.
- Boxes: growing, filled, shadowed, invisible, etc.
- Display strings: centered, vertical, etc.
- Displaying: EGA/VGA 43/50 lines mode, colors, etc.
- Sidekick Plus style directory.
- Input from user: key, line, upper cased line.
- Pause the computer for a certain period of time.
- Scrolling.
To see these features, go back to the DOS prompt and run
BENDEMO.BAT, and keep in mind that what you will see is only
a batch file.
───────────────────────────────────────────────────────────
1.2 Requirements:
IBM PC/Compatible with PC/MS-DOS 2.1 or higher.
(3.3 or higher recommended. If you are using a version lower
than 3.3, whenever in this document the command "CALL" is
used, change it to "COMMAND /C".)
Optional: ANSI.SYS or equivalent.
(Note: ANSI is a computer standard that every user should
have. If you did not install it yet, BENDEMO.BAT will not
run properly; and the option COLORNOW is diminished.
Therefore ANSI is highly recommended. ANSI.SYS is included
with all PC/MS-DOS. If you require aid in installing, please
refer to the appendix.)
───────────────────────────────────────────────────────────
2.1 Command Parameters
Command: [d:][path]BEN.EXE [options][options...]
The first [d:][path] specifies the pathname for BEN.
You can stack as many options on one line as the environment
can hold. For example, "BEN DELAY 3000 ATTRIB 7 0" is a
command line with 2 options. Just enter options one after
another. Each option has several parameters which you will
need to pass to it. In this case, they are 3000, 7 and 0.
The above line is exactly the same as:
BEN DELAY 3000 } 3000 are the
BEN ATTRIB 7 0 } 7, 0 parameters.
Note: Never stack several options that uses BENBAT on a
single line of command. They are identified with an
asterisk (*) following on.
Anything after the ECHO option is thought to be
parameters, therefore never use any option after using
ECHO on one command line.
Options: (briefly discussed:)
Upper case = mandatory words.
Lower case = parameters which need substitution.
[in bracket] = optional parameters.
(No option entered)
Just by typing BEN will provide you with few help screens.
Also, the UNREGISTERED message will only appear in this
section of BEN.
1> ASK options <────── (Such as this. "options" is a parameter.)
This command wait for the user to press a key, and return an
errorlevel according to the key.
2> ATTRIB fground bground
Clears the screen with the specified colors.
3> BEEP
Creates a "beep" sound.
4> BOX x1 y1 x2 y2 fground bground bordertype boxtype
Creates a box on the screen.
5> COLORNOW fground bground
* Changes the current writing color.
6> CURSOR [ON][OFF]
Shows or hides the text cursor.
7> DIRDISP directory return
* Displays a SideKick Plus style directory and allows the user
to select a file or change directories.
8> DELAY milliseconds
Delays the computer for a certain period of time.
(Note: 1 second = 1000 milliseconds.)
9> ECHO fground bground word1 [word2...]
Writes a string onto the screen. Identical to the DOS ECHO.
10> EGAVGA [ON][OFF]
Turns the EGA/VGA 43/50 lines mode on or off.
The presence of EGA/VGA is passed into the DOS errorlevel:
0 = No, 1 = Yes.
11> GOTOXY x y or
GOTOXY T textfile
Goes to the certain part of the screen as specified in x and y.
12> INLINE
* Inputs a line of string from user.
13> INLINEU
* Inputs a line of string from user, and convert it to
upper case.
14> INKEY
* Inputs a character from the user.
15> MENU title totalchoices choice1 [choice2...]
* Displays a manual on the screen, and allow the user to select
a choice.
16> SOUND frequency duration [frequency duration...] or
SOUND T textfile
This option is used to play music.
17> SCROLL x1 y1 x2 y2 direction or
SCROLL T textfile
Scrolls text on the screen in any of the four directions.
18> T textfile
Uses a data file to perform BEN jobs OPTIMIZED!
19> WRITE fground bground wordcount word1 [word2...]
Displays a string onto the screen.
20> WRITEC fground bground wordcount word1 [word2...]
Displays a centered string onto the screen.
21> WRITEV x y fground bground wordcount word1 [word2...]
Displays a vertical column of string onto the screen.
* - returns from BEN is passed into BENBAT.BAT. When it is
called, the value is then passed into the environment
variable "BEN", in which the batch file can access. For
more details about BENBAT, please refer to 2.3.
───────────────────────────────────────────────────────────
2.2 In Depth - Options
(Suggestion: Spend a moment trying out the commands, or
refer to BENDEMO.BAT.)
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
1> ASK options
This command reads a character from the keyboard similar to
INKEY, and then matches it to the string parameter
"options". If the inputted character matches to any
component in "options", the position of it in "options" is
then sent to DOS errorlevel. (For more information about
errorlevel, please refer to your DOS manual.) If the key
does not match to any character defined in "options", the
program will produce a beep, and repeat the loop until the
user press one of the right key. Example:
ECHO Please press 1, 2, 3, 4, or X.
BEN ASK 12345X <───── Test if user presses "1","2","3","4","5",or"X"
If errorlevel 6 goto KeyX {The 6th position in "12345X", which is X}
If errorlevel 5 goto Key5
If errorlevel 4 goto Key4
If errorlevel 3 goto Key3
If errorlevel 2 goto Key2
If errorlevel 1 goto Key1 {The 1st position in "12345X", which is 1}
:Key1
Echo 1
Goto end
:Key2
Echo 2
Goto end
:Key3
Echo 3
Goto end
:Key4
Echo 4
Goto end
:Key5
Echo 5
Goto end
:KeyX
Echo End
:End
This example demonstrated the use of ASK. Firstly, when it
is ran from DOS as a batch file, BEN will read a key from
the user, and matches it to the string. In this case
"12345X". If the entered key is 1, 2, 3, 4, 5 or X (upper or
lower case), then the corresponding errorlevel is returned
to DOS. (1, 2, 3, 4, 5 or 6) In this example, if the user
presses X, then the errorlevel will be 6, because "X" is the
sixth character in the "options" parameter - "12345X". If the
user presses 2, then the errorlevel will be 2. If the user
presses Q (a key not defined), the program will beep and
wait for another keystroke to be processed.
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
2> ATTRIB fground bground
This command clear the entire screen with the foreground
color in the parameter fground and the background color in
the variable bground.
(For detail on color numbers, refer to appendix)
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
3> BEEP - this command just creates a beep sound. No
parameter is needed.
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
4> BOX x1 y1 x2 y2 fground bground bordertype boxtype
This command is a very complex one. I will try to explain as
clearly as possible, since it's very important.
1> It creates a box on the screen.
2> x1 and y1 are co-ordinations of the top-left corner.
3> x2 and y2 are co-ordinations of the lower-right corner.
4> Fground defines the foreground color of the box.
5> Bground defines the background color.
6> There are several border types as defined in the
parameter (bordertype):
0 - No border.
1 - Single line border. Like this: ───
2 - Double line border. Like this: ═══
3 - Single top/bottom and double sides border.
4 - Double top/bottom and single sides.
(Normal Box)
5 - No border. However the contents of the box is painted.
It is similar to using the attrib command. The
difference is that it does not clear the screen, and it
only paints the area designated in the variables
x1,y1,x2,y2. This function must be used together with
the normal box type. (In short, it changes the
attributes of a certain text on the screen.)
(Filled Box and Growing Filled Box:)
5 .. 9 - Same as 1 .. 4, except with shadowing.
(All kind of boxes)
10 .. 255 - The corresponding ASCII character as the border.
There are 3 box types:
N - Normal Box. (Only outline of box is colored, contents
are not.)
F - Filled Box. (The whole box is filled, including
contents. The text originally inside the box is erased.)
G - Growing Filled Box. (Same as Filled Box, except the box
"explodes" or "grows" out.)
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
5> COLORNOW fground bground
Changes the current writing color via ANSI.SYS. (Must
install it in order to use COLORNOW.) It is called through
BENBAT.BAT, however, it doesn't set any environment
variable. It uses the ECHO command to change the current
writing color.
Note: GOTOXY will lose its effect after calling COLORNOW.
Remember to use GOTOXY AFTER using COLOWNOW.
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
6> CURSOR [ON][OFF]
Use this command to make the text cursor appear or
disappear. Use CURSOR OFF to hide it, and CURSOR ON to make
it appear.
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
7> DELAY milliseconds
The computer will sleep (pause) for the certain amount of
milliseconds as defined in the parameter "milliseconds".
Note: 1 second = 1000 milliseconds.
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
8> DIRDISP directory return
This option displays a Sidekick Plus style directory and
allows the user to select a file or change directories. The
user may use the cursor keys to move around the directories,
and use the ENTER key to choose the file. The filename
returned by the user is passed to BENBAT.BAT. For more
details concerning BENBAT, see 2.3. "Directory" defines the
directory and the files to display to the user. There are 5
"return" types available as defined in the 2nd parameter:
"F" - Full return. (Same as "D,P,N,E" together.)
Eg. C:\TELECOM\MODEM\MYCOMM\ABC.DOC
"D" - Only drive letter returned.
Eg. C (Colon not included)
"P" - Only pathname returned.
Eg. \TELECOM\MODEM\MYCOMM
"N" - Only filename returned.
Eg. ABC
"E" - Only extension returned.
Eg. DOC
For example, to display the directory C:\DOC\STORY:
"BEN DIRDISP C:\DOC\STORY\*.* P" may be issued.
If the user selects a file named "C:\DOC\STORY\MY.TXT", then
"\DOC\STORY" will be passed to BENBAT.BAT. If the user
presses ESC while using this command, the string "ESC" is
passed to BENBAT.
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
9> ECHO fground bground word1 [word2...]
This option is mainly used together with the T option of
BEN. It can write a string onto the screen, similar to the
DOS ECHO command. The only difference between this option
and the WRITE option is that this command does not need a
wordcount variable. (Please refer to the WRITE command.)
However ECHO will think that everything on the command line
after it are parameters. Therefore after using ECHO, you can
not add any more options onto the command line. The fground
and the bground parameters define the color of the text. Eg:
BEN ECHO 7 2 Hello User! This is a great day!
Using this command, the following text:
"Hello User! This is a great day!" will be displayed onto
the screen in a green background and a gray foreground. The
major use of ECHO is to use it with the T option. In the T
text file, you can use this command to replace the DOS ECHO
command. With this option, you can also write environment
variables onto the screen. Eg:
BEN ECHO %Username% is a good guy.
If %Username% is "Simon Lee", then BEN will write:
"Simon Lee is a good guy" onto the screen, without any
worries of the wordcount variable used in the WRITE command.
Note: The drawback is you can not use any more BEN options
after using ECHO. Eg:
BEN ECHO Hello, this is a 7 words sentence. ATTRIB 7 1 INKEY
would display the following onto the screen:
"Hello, this is a 7 words sentence. ATTRIB 7 1 INKEY"
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
10> EGAVGA [ON][OFF]
This option tests the presence of the EGA/VGA card, and the
result is returned into the DOS errorlevel (0 = not present,
1 = present.)
If the card is present, this option can also change the
current mode between 25 lines and 43/50 lines. The command
is "EGAVGA ON" or "EGAVGA OFF", where ON specifies the 43/50
lines mode and OFF specifies the 25 lines mode. Example:
BEN EGAVGA ON
will test the presence of the EGA or VGA card. If the card
is present, then the errorlevel of 1 is returned, and the
mode is changed into 43/50 lines. However, if the EGA or VGA
card is not found, the program would return an errorlevel of
0 and the line mode would not change.
(Note: EGA uses 43 lines, and VGA uses 50.)
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
11> GOTOXY x y
Move the text cursor to certain part of the screen as
specified in x and y co-ordination parameters.
For example, BEN GOTOXY 2 20 will go to row 20, column 2.
GOTOXY T textfile - Read a textfile (ASCII) and perform the
functions as written in the textfile. You can write a file
using text editors such as the EDLIN supplied with DOS. The
text file format is as follows:
FGROUND BGROUND <CR>
X Y <CR>
TEXT <CR>
X Y <CR>
TEXT <CR>
...
X Y <CR>
TEXT <CR>
<End of File>
The first line defines the foreground and background color
of all the texts that follows.
Then, starting from the second line, the format is:
X Y - The column and row that GOTOXY have to jump to for the
writing of the text.
TEXT - The TEXT to write onto the screen immediately after
the text cursor jumped to the position defined by X
and Y.
Example: TEST.DAT
15 1 <CR>
5 5 <CR>
Hello, My name is Super Dave! <CR>
7 5 <CR>
See you later! <CR>
<End of File>
Use BEN GOTOXY T TEST.DAT to run the data file.
This example will use white foreground and blue background
for text writing. First, BEN will jump to column 5, row 5,
and it will write the text "Hello, My name is Super Dave!"
Then it will jump to column 7, row 5, and it will write the
text "See you later!" Please consult the BENDEMO file for
more examples.
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
12> INLINE
Input a line of text from the user. The string is
then passed to BENBAT.BAT.
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
13> INLINEU
Same as INLINE, except the string is filtered into an upper
case string. For example, if the user input "I am a
Canadian", "I AM A CANADIAN" would be passed to BENBAT.BAT.
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
14> INKEY
Input a character from the user. The character is
then passed to BENBAT.BAT.
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
15> MENU title totalchoices choice1 [choice2...]
This option is used to display a nice-looking menu centered
on the screen, allowing the batch file user to select from
up to 20 choices. "Title" defines the title name of the
menu. "Totalchoices" defines the number of choices that the
user can select. "Choice 1" defines the name of the first
choice, etc.
The return is passed into the DOS errorlevel, it consists of
an integer, which is the corresponding choice number that
the user selected. If the user presses ESC in the menu, the
integer 0 will be returned to DOS errorlevel. (For more
information about errorlevel, please refer to your DOS
manual.)
For example: MENU Main 3 Savefile Loadfile Quitfile:
will show a menu titled "MAIN" with 3 choices of Savefile,
Loadfile and Quitfile.
If the user selects Loadfile, an errorlevel of 2 will be
returned.
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
16> SOUND frequency duration [frequency duration...] or
SOUND T textfile
This command plays a piece of music as defined by the batch
file writer. The frequency variable defines the frequency of
sound to play, and the duration defines the duration of this
sound in milliseconds. For example SOUND 300 300 400 300
would create two different sounds the same duration, with
the second one a bit higher than the first. Computers with
different speed would sound differently.
The second way of playing music is through a text file in
ASCII format. This file is named in the variable "textfile"
and would be played when this command is issued. For
example, to play a textfile called YANKEE.MUS, you issue the
command: BEN SOUND T YANKEE.MUS.
You can create this ASCII file with any text editor, such as
EDLIN supplied with DOS. The structure of this ASCII file is
as followings:
FREQUENCY DURATION <CR>
FREQUENCY DURATION <CR>
FREQUENCY DURATION <CR>
...
FREQUENCY DURATION <CR>
<End of File>
Each line of the ASCII file defines 2 numbers, whereas the
first is the frequency and the second is the duration.
(Note to user: Do not use a frequency or duration lower than
0 with the SOUND command, or the system would crash. To make
a pause in a music piece, give the frequency of 0, which
will tell the computer not to play any sound for the time
period as defined in DURATION.)
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
17> SCROLL x1 y1 x2 y2 direction or
SCROLL T textfile
This command scrolls text on the screen in any of the four
directions: "UP", "DOWN", "LEFT" and "RIGHT".
a) x1 and y1 are coordinates of the top left corner of the
region to be scrolled.
b) x2 and y2 are coordinates of the bottom right corner.
c) The variable DIRECTION defines the direction in which the
block will move: UP, DOWN, LEFT, RIGHT.
The area which the block moves away from is replaced by a
blank line.
For example: "BEN SCROLL 3 3 40 20 Up" will scroll the text in
the block between 3,3 and 40,20 up one position. The second
way of using SCROLL, which is more efficiently, is to use a
text file. (Defined in the parameter TEXTFILE.) The text file
is an ASCII file which can be created by text editors such
as DOS's EDLIN. The format of the text file is as follows:
PAUSE IN MILLISECOND
X1, Y1, X2, Y2, DIRECTION <CR>
X1, Y1, X2, Y2, DIRECTION <CR>
X1, Y1, X2, Y2, DIRECTION <CR>
...
X1, Y1, X2, Y2, DIRECTION <CR>
<End of File>
The first line of this text file will declare the pause in
milliseconds between each line of scrolling command. The
rest of the file have command lines that are the same with
the normal use of SCROLL. Suppose the file is called
BENDATA.DTA, then issuing BEN SCROLL T BENDATA.DTA will
perform the functions declared in the text file. Consult
BENDEMO.BAT for more examples.
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
17> T textfile
This option is the most important new option presented in
BEN 2.50. It can read a normal text file, (ASCII format
which can be created with any text editor, such as EDLIN
which is bundled with DOS.) and perform the options in it.
This allows a much quicker operation of BEN, making it
unnecessary to reload BEN over and over again. The format of
the text file is as follows:
OPTIONS
OPTIONS
OPTIONS
...
OPTIONS
<End of File>
The OPTIONS are exactly the same as the options called directly
from the batch file. For example:
BEN BOX 1 1 80 25 7 1 1 G INKEY
BEN CURSOR OFF ATTRIB 7 0
is exactly the same as
BEN T DATA.DAT
where DATA.DAT contains:
BOX 1 1 80 25 7 1 1 G INKEY
CURSOR OFF
ATTRIB 7 0
<End of File>
Please consult BENDEMO.BAT for some more examples.
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
18> WRITE fground bground wordcount word1 [word2...]
This function replace the ECHO command of DOS, thus BEN runs
faster without reloading itself again if other options are
ran in conjunction. It also adds color to prompts which DOS
ECHO can not do. The fground and bground parameters defines
the color of the string to write. wordcount defines the
number of words in the string. Word1 will be the first word,
etc. EXAMPLE:
BEN COLORNOW 7 1
CALL BENBAT
BEN GOTOXY 5 5
ECHO Hello, this is Super Dave again.
can be replaced into just one line with WRITE:
BEN GOTOXY 5 5 WRITE 7 1 6 Hello, this is Super Dave again.
WRITE is a very good alternative to ECHO, however it still
has some inabilities, such as unabling to write more than one
space between two words. Example:
To write "Hello, I am a good man." onto the screen, you
must use ECHO like this: "ECHO Hello, I am a good man."
If you use BEN, it doesn't work:
"BEN WRITE 7 0 6 Hello, I am a good man" will produces
"Hello, I am a good man." on the screen.
(Note: This can be fixed if you use ASCII NUL character.
Please read 3.1 for hints and tips.)
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
19> WRITEC fground bground wordcount word1 [word2...]
Same as WRITE, except the string is centered nicely on the
screen. For example:
BEN WRITEC 7 0 4 Hello Ladies and Gentlemen!
will place the string "Hello Ladies and Gentleman" on the
screen, centered, and in gray foreground and black
background.
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
20> WRITEV x y fground bground wordcount word1 [word2...]
This option put a vertical column of text onto the screen. X
and Y are the coordinates of the top character. F and B are
the foreground and background display colors. Wordcount is
the number of words present and word1, word2, etc. are the
words to display. Eg.
BEN WRITEV 1 1 7 2 3 Hello User! Hello!
will write a vertical column of text "Hello User! Hello!"
onto the screen at the top-left corner of the screen, in a
green background and a gray foreground.
───────────────────────────────────────────────────────────
2.3 BENBAT.BAT
The value returned from COLORNOW, DIRDISP, INLINE, INLINEU
and INKEY will be passed into a file named BENBAT.BAT. When
BENBAT.BAT is "call"ed from your batch file, the value will be
passed onto the environment variable "BEN", therefore the
batch file can process that information. (Note: Screen
information returned from COLORNOW is different. It does not
call the environment variable, however it calls ANSI.SYS.)
(For more information about environment variable, please
consult your DOS menu.) For example, a batch file like this:
@Echo off
BEN ATTRIB 15 1
Echo Please enter your name.
BEN INLINE
Call BENBAT <─────── (Pass what the user type into %BEN%)
:REM Change "CALL" to "COMMAND /C" if
:REM your DOS version is lower than 3.3.
Echo %BEN% is the best. (Use the env't variable %BEN%)
Del BENBAT.BAT
This file will clear the screen with a blue background and a
white foreground. The batch file then will ask you for your
name. For example, use Daniel. Afterwards, the batch file
will respond with "Daniel is the best". One final note,
remember to delete BENBAT.BAT when you finish the batch
file.
───────────────────────────────────────────────────────────
3.0 I still do not understand how to use BEN, what do I do?
Try to play with the commands with BEN for a while, then you
will get it. Also, examine our supplied sample batch file.
The best way to learn it is to print this document, and
follow the instructions in the document while trying out on
the computer.
───────────────────────────────────────────────────────────
3.1 Hints and Tips:
- If you run out of environment space to store items
returned from BEN, put the following command at the start
of the batch file:
PATH > $RMBRTMP.BAT
PATH;
and put the following at the end of the batch file:
CALL $RMBRTMP
DEL $RMBRTMP.BAT
- Another way is to increase your environment space by using
the SHELL command of DOS. Please consult your DOS manual.
- If you use the BOX command, you can create good-looking
borders also by specifying an ASCII number (5+) in the
variable "bordertype". For example:
BEN BOX 1 1 80 25 7 0 251 N will create a box around the
screen with a border made up of "√".
- Using WRITE, or MENU, you can create hard-spaces between
words using the NUL character, ASCII 255. This character
is created by depressing ALT, and tapping the numeric
keyboard "2" "5" and "5". When BEN sees NUL, it will think
that this space character is a normal character. For
example you can use this command without error:
BEN WRITE 7 1 1 HELLO I AM THE BEST!
specify ─────┘ ^ ^ ^
1 word. These are NULs instead of spaces.
Look at the demo batch file for more example.
- Using a disk optimizer on your disk containing BEN will
speed up the operation of BEN up to 200%.
──────────────────────────────────────────────────────────
4.0 Bugs report, comments, problems...
If you feel that this manual is inadequate, or uncover any
bugs or problems, please mail a letter to me concerning
that matter to:
Simon Lee,
301 Holmes Ave.,
Willowdale, Toronto,
Ontatio, Canada.
Comments are extremely welcome.
───────────────────────────────────────────────────────────
History of BEN.EXE:
Version 2.50 as of 01/04/90:
- Speeded up internal processing.
- Added four new commands: ECHO, EGAVGA, T, WRITEV.
- Allows the use of a text file for all the BEN commands.
- Document changed to the new SIMVIS format. Clearly
re-editted.
- HISTORY.DOC integrated into BEN.DOC.
Version 2.20 as of 10/28/89:
- Added three new commands: CURSOR, SCROLL and WRITEC.
- Enhanced BENDEMO.BAT. (Although added two data files.)
- Fixed a bug in BOXING AROUND in BENDEMO.BAT.
Version 2.10 as of 10/21/89:
- Added a new command: ASK.
- Improved MENU command, unnecessary to call BENBAT anymore.
- Better HISTORY.COM.
- Blinking "Unregistered Version" when typing "BEN" alone.
- Added the $19 registration option.
- Added new features in BENDEMO.BAT.
Version 2.00b as of 10/16/89:
- Fixed a minor bug in BENDEMO.BAT.
- Fixed a minor bug in HISTORY.DOC.
- Fixed documentation.
- Added ORDERFRM.TXT with BEN.
Version 2.00a as of 10/15/89:
- Fixed two bugs in BENDEMO.BAT
Version 2.00 as of 10/15/89:
- Splitted one big Turbo Pascal program into a program and a unit.
- Program run faster.
- New commands: COLORNOW, DELAY, GOTOXY, SOUND and WRITE.
- Improved DIRDISP command, allow extraction of a certain part of
a full path name.
- Demo batch file added.
- Better documentation.
Version 1.00 as of 10/11/89:
- First release of BEN.EXE.
Preview of next version:
- Add the batch editor as suggested by Jay Norwalk.
- More capability of the use of ANSI.SYS.
- Speedier BEN.
───────────────────────────────────────────────────────────
Acknowledgments: CompuSoft Lab (Erik and Edwin Lee).
Jay Norwalk
───────────────────────────────────────────────────────────
Trademarks:
IBM and PC-DOS are trademarks of Internation Business
Machines Corporation. FASTBACK is trademark of Fifth
Generation Software. MS-DOS and EDLIN are trademarks of
Microsoft Corporation. STRIGGER, SIM-RMD, BEN and MAGIK MENU
are trademarks of SIMVIS SOFT.
───────────────────────────────────────────────────────────
Disclaimer:
Use of this program acknowledges this disclaimer of
warranty: "This program is supplied as is. SIMVIS SOFT
disclaims all warranties, expressed or implied, including,
without limitation, the warranties of merchantability and of
fitness of this program for any purpose. SIMVIS SOFT assumes
no liability for damages directly or consequential, which
may result from the use of this program."
───────────────────────────────────────────────────────────
Appendix:
Installing ANSI.SYS which comes with DOS
----------------------------------------
1> Find ANSI.SYS from your DOS distribution disk and put it
in the directory you want.
2> Add the following line to CONFIG.SYS by using this
commands:
C> COPY CONFIG.SYS+CON CONFIG.SYS
CONFIG.SYS
CON
DEVICE=C:\ANSI.SYS
^Z
That's all! For the device line, change C:\ANSI.SYS to the
directory you put ANSI.SYS in. ^Z is done by pressing
CTRL-Z.
Color number
------------
0 - black 8 - black
1 - blue 9 - light blue
2 - green 10 - light green
3 - cyan 11 - light cyan
4 - red 12 - light red
5 - purple 14 - light purple
6 - magenta 13 - yellow
7 - lightgray 15 - white
Registration
------------
You are granted a limited license in the trial of this
software for thirty days for no obligations. After thirty
days, you must register in order to continue to use the
program. There are two kinds of Registration:
1) STRIGGER, SIM-RMD and BEN for $34
Registration will provide you with:
- The newest version of BEN.
- A printed manual.
- Your name cypted into the program BEN.EXE.
- You may distribute registered versions. (With your name).
- Bundled with the newest version of BEN and SIM-RMD,
which also have your name crypted into them, including
their printed manual.
- Two free upgrades of all three programs. Disks only.
- Unlimited use of all three programs.
- License to distribute STRIGGER, SIM-RMD or BEN together
with any of your programs in an unmodified form.
- (Totally nine programs on three or more disks.)
2) BEN only for $19
Registration will provide you with:
- The newest version of BEN.
- Printed manual.
- Your name cypted into the program BEN.EXE.
- You may distribute your registered version. (With your
name)
- A free upgrades of BEN. Disk only.
- Unlimited use of BEN.
- License to distribute BEN together with any of your
programs in an unmodified form.
For only $34 dollars, or $19 now (US funds if ordered in
US. US or Canadian funds if ordered in Canada), you will
be a registered user. Just send a cheque, together with
the orderform (ORDERFRM.TXT) to:
SIMON LEE,
301 Holmes Avenue,
Willowdale, Toronto,
Ontario, Canada.