home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Pier Shareware 6
/
The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso
/
010
/
batmnu24.zip
/
BATMNU24.DOC
< prev
next >
Wrap
Text File
|
1994-10-11
|
46KB
|
1,068 lines
┌────────────────────────────────────┐
│ ╔══════════════════════════════╗ │▒▒
│ ║ ║ │▒▒
│ ║ BATMNU ║ │▒▒
│ ║ Batch File Menu System ║ │▒▒
│ ║ Version 2.4 ║ │▒▒
│ ║ ║ │▒▒
│ ╚══════════════════════════════╝ │▒▒
└────────────────────────────────────┘▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
October 11, 1994
TABLE OF CONTENTS
1.0 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2.0 MENU FORMAT . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2.1 General Format Rules . . . . . . . . . . . . . . . . . . . . 2
2.2 Window Options . . . . . . . . . . . . . . . . . . . . . . . 2
F#, B# Foreground/Background Color . . . . . . . . . . . . . 3
T# Title Color . . . . . . . . . . . . . . . . . . . . . . . 3
O# Option Color . . . . . . . . . . . . . . . . . . . . . . 3
H# Hotkey Color . . . . . . . . . . . . . . . . . . . . . . 3
K# Clear Screen . . . . . . . . . . . . . . . . . . . . . . 3
K#string Clear Screen with String . . . . . . . . . . . . . 3
E# Screen Border Color . . . . . . . . . . . . . . . . . . . 3
Bar-#/# Highlight Bar Color . . . . . . . . . . . . . . . . 3
Color Values . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3 Window Appearance . . . . . . . . . . . . . . . . . . . . . . 4
S# Shadow . . . . . . . . . . . . . . . . . . . . . . . . . 4
C Center Options . . . . . . . . . . . . . . . . . . . . . . 4
W Wide Menu . . . . . . . . . . . . . . . . . . . . . . . . 4
L, N Lettered, Numbered Options . . . . . . . . . . . . . . 5
A, AN Auto Hotkey, Auto Hotkey/No Case . . . . . . . . . . . 5
M# Menu Border . . . . . . . . . . . . . . . . . . . . . . . 5
+ Join Lines . . . . . . . . . . . . . . . . . . . . . . . . 5
R#, C# Row, Column . . . . . . . . . . . . . . . . . . . . . 5
No_Margin No Wide Margin . . . . . . . . . . . . . . . . . . 5
Popup Save/Restore Screen Contents . . . . . . . . . . . . . 6
No_Bar No Highlight Bar . . . . . . . . . . . . . . . . . . 6
2.4 Other Window Options . . . . . . . . . . . . . . . . . . . . 6
X No Mouse . . . . . . . . . . . . . . . . . . . . . . . . . 6
P# Screen Saver Pause . . . . . . . . . . . . . . . . . . . 6
V#[var] Option Value Return . . . . . . . . . . . . . . . . 6
~ Escape . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Auto_Help Automatic Extended Help . . . . . . . . . . . . . 7
2.5 Option Lines . . . . . . . . . . . . . . . . . . . . . . . . 7
2.6 Option Help . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.7 Headers and Footers . . . . . . . . . . . . . . . . . . . . . 9
F#, B# Foreground/Background Color . . . . . . . . . . . . . 9
T#, D# Time and Date . . . . . . . . . . . . . . . . . . . . 9
Popup Save/Restore Header and Footer Line . . . . . . . . . 10
3.0 WHAT HAPPENS IN THE BATCH FILE? . . . . . . . . . . . . . . . . . 10
4.0 MENUS WITH PARAMETERS . . . . . . . . . . . . . . . . . . . . . . 11
5.0 MOUSE SUPPORT . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6.0 SCREEN SAVER . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
7.0 SHAREWARE INFORMATION . . . . . . . . . . . . . . . . . . . . . . 12
7.1 New Security Version . . . . . . . . . . . . . . . . . . . . 13
7.2 New Utility Available . . . . . . . . . . . . . . . . . . . . 13
7.3 Bonus Program . . . . . . . . . . . . . . . . . . . . . . . . 14
8.0 BATMNU History . . . . . . . . . . . . . . . . . . . . . . . . . . 14
APPENDIX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
BATMNU v2.4
─────────────────────────────────────────────────────────────────────────
1.0 INTRODUCTION
─────────────────────────────────────────────────────────────────────────
This program is a menuing system for use with your batch files. It is
not intended to be a shell, although with some very ambitious batch file
programming, it could be used as one. Even nested menus are possible. Its
purpose is to provide sophisticated flow control and give batch files a
professional appearance by creating a point-and-shoot menu with up to 26
options per menu. The cursor keys and the HOME and END keys can then be
used to make the selection. Each option can be selected by a 'hotkey'
defined by your menu. A mouse is also supported if detected and there is
a Screen Saver feature to protect your display.
BATMNU should run on any IBM PC compatible. Use of this program requires
an understanding of batch file programming and DOS. Without that you will
have difficulty extracting the full potential of BATMNU.
1.1 Syntax
─────────────────────────────────────────────────────────────────────────
The batch file created to utilize BATMNU needs a line in the following
format:
BATMNU [d:][path]filename [label] [default]
The program defaults to a filename extension of "mnu" if none is
provided. The filename can indicate a separate file or, if you prefer,
the menu can be within the calling batch file. You will have to code the
batch file so those lines are never executed, of course. (See the file
NORTON.BAT for an example of a menu within a batch file.) If a separate
file is used, it can be 'hidden' making it more secure from tampering.
The optional label parameter can be used if you wish to put more than one
menu within the file. Bracket your menu lines with ":label" and
":end_label". BATMNU will search your path for the file if it's not in
the current directory. The label can be up to 15 characters long. The
default is "Menu".
The default parameter on the command line is used if you want an option
other than the first one to be highlighted when the menu starts. e.g.
"BATMNU NORTON.BAT 3" will highlight the third option and place the mouse
cursor, if used, next to it.
2.0 MENU FORMAT
─────────────────────────────────────────────────────────────────────────
:menu {keyword to mark where the program should start reading}
header,header text
h_format,fYEL,bred,t1,d1 {header colors, time, date}
window,tRED,hWHI,... {colors and window appearance definition}
title,title text
option,option text,[#] {# indicates hotkey position in option text}
1
Documentation
─────────────────────────────────────────────────────────────────────────
help,help text {must follow option help refers to}
option,option text,[#][,[drive],[directory],pgm] {optional format}
option...
.
.
.
msg,message text {Appears below menu options}
footer,footer text
f_format,fYEL,bred,t1,d1 {footer colors, time, date}
:end_menu {Program stops reading and closes the file}
2.1 General Format Rules
─────────────────────────────────────────────────────────────────────────
The definition can be organized in almost any order as long as it is
placed between the ':menu' and ':end_menu' keywords (or other label if
provided on the command line). The window line should appear before the
options if you use the 'l', 'n' or 'a' parameter. Maximum title and
message length is 54 characters. Headers and footers can be 70 characters
long if the time and/or date are not used. If you leave the title out,
your menu will contain only your defined options. Header and footer are
optional. Maximum option length is 50 characters for single column menus
and 25 characters for double column.(See "no_margin" description on page
5 for longer title, message and option lines.) Maximum help length is 70
characters.
All parameters on the window, h_format and f_format lines are separated
by a comma. Spaces are ignored. The keywords can be indented for clarity,
if desired, using spaces or TABs.
Environment variables can be used within the header, footer, options,
help lines, title or message. The variables are indicated by surrounding
the name with the percent (%) sign, just as you would on a batch file
command line. The variable's value is inserted when the menu is
displayed. If the variable is not found, the variable name is used as it
appears in the menu with % signs.
2.2 Window Options
─────────────────────────────────────────────────────────────────────────
The "window" line in your menu will define the colors, appearance and
actions of your menu. Each switch or keyword should be separated by a
comma. The color options are:
f# - foreground color of window (0-15)
b# - background color of window, (0-7)
t# - title color (0-15)
o# - option color (0-15)
h# - hotkey color (0-15)
k# - screen color (clears screen), foreground(0-15), background(0-7)
e# - screen border color (0-15)
2
BATMNU v2.4
─────────────────────────────────────────────────────────────────────────
Bar-#/# - highlight bar foreground / background color
F#, B# Foreground/Background Color
These options define the color of the window background and the
foreground color of the border. Default: FYEL, Bblu
T# Title Color
The title and message text will appear in this color. Default: TWHI
O# Option Color
Menu options will have this color. Default: OCYA
H# Hotkey Color
The hotkey for each option will have this color. A special color
option for this switch is INV which makes the hotkey invisible, i.e.
the same color as the option text. The option can still be selected
by the hotkey, however. Default: HRED
K# Clear Screen
The 'k' option fills double duty setting the foreground and
background color for the screen. The first k parameter will set the
background, the second the foreground (Foreground default is "whi"
if not specified). The foreground color is used with the fill
character. The fill character can appear after the color of either
to give the screen background more interest than a flat color. Use
of the drop shadow is more dramatic too.
K#string Clear Screen with String
If you prefer, a string could be used to fill the screen background.
Either words or special characters could be used. Put the string
after the color as above. If you want to add spaces, use the
underscore (_) character. It will be treated as a space when
displayed. (e.g. kred_Main_Menu)
E# Screen Border Color
The 'e' option sets the screen border color which is outside the
normal text area. An 'e' used alone will reset the border to its
normal black.
Bar-#/# Highlight Bar Color
By default, BATMNU uses a mask to define the colors for the
highlight bar. They are chosen in such a way that the bar and the
text will always be visible. This switch allows you to define the
color yourself. Using "bar-" alone will give you the default Bright
White on Black bar. You can define either or both colors. To get
Bright Red on Black use, "bar-RED". For Bright White on Blue, "bar-
/blu". "bar-BLU/whi" will give you bright Blue on White. To
eliminate the highlight bar, see "No_Bar" on page 6.
3
Documentation
─────────────────────────────────────────────────────────────────────────
Color options should be followed by one of the color values shown in the
chart below.
Color Values
0 or bla = Black 8 or BLA = Grey
1 or blu = Blue 9 or BLU = Bright Blue
2 or gre = Green 10 or GRE = Bright Green
3 or cya = Cyan 11 or CYA = Bright Cyan
4 or red = Red 12 or RED = Bright Red
5 or mag = Magenta 13 or MAG = Bright Magenta
6 or yel = Brown 14 or YEL = Yellow
7 or whi = White 15 or WHI = Bright White
Default colors are provided (fYEL, bblu, tWHI, oCYA, hRED) and the
options will be left-justified. The menu will be in single column format
unless it exceeds 13 options. It will have a double line frame (m2).
Default colors for headers/footers are fWHI, bred.
2.3 Window Appearance
─────────────────────────────────────────────────────────────────────────
The window appearance options are:
s# - shadow on, 1-4 to position shadow relative to menu
c - center each option individually
w - display in wide, 2 column format, default for > 13 options
l - default to letter selection of options
n - default to number selection of options, maximum of 10 options
a[n] - automatic selection of hotkeys. [optional no case favoring]
m# - menu frame type, 0- none, 1- ┌─, 2- ╔═, 3- ╒═, 4- ╓─, 5- █▀
+ - join title and message divider lines to border
r# - top row for menu window
c# - left column for menu window
No_Margin - display menu without wide margin around the frame
Popup - save entire screen and restore when menu closes
No_Bar - no highlight bar
S# Shadow
The shadow position is set with the 's' option. 1 is below and to
the right. 2 is below and the to left. 3 is above and to the right.
4 is above and to the left. The 's' option alone defaults to 1.
C Center Options
Menu options are normally left justified. If you want your options
centered in the menu, use the 'c' switch.
W Wide Menu
If you want a 2 column menu, the 'w' switch will force BATMNU into
this mode. As a default, menus with more than 13 options are always
displayed this way.
4
BATMNU v2.4
─────────────────────────────────────────────────────────────────────────
L, N Lettered, Numbered Options
The 'l' option will place a letter in front of every option to be
used as the hotkey. This can be useful when you have a large number
of options or if you just prefer it that way. The 'n' option is for
those who prefer numbered menus. Naturally, only 10 options are
possible with numbers as hotkeys. The 'c' option is overridden if
you use 'l' or 'n'. With these options, your maximum option length
is reduced by 3 characters and the hotkey position will be set to 1.
If you follow the 'l' or 'n' with another character such as a dash,
period or parenthesis, this will be used as a separator. (e.g. 'l-'
will produce 'A-', 'B-', etc for the menu.)
A, AN Auto Hotkey, Auto Hotkey/No Case
It is not necessary to specify the hotkeys for your options. If you
leave this information out, BATMNU defaults to the first character.
By using the 'a' switch, BATMNU will make sure you don't end up with
duplicates. It makes a one-pass search to find unique letters for
all the options. You can override the selection by indicating the
hotkey on the option line. The search favors uppercase letters
unless the no-case modifier is used, 'an'.
M# Menu Border
The menu border is controlled with the 'm' switch. The default value
is 2 which will use a double line border. It is also possible to
specify a custom character to outline the menu. Follow the 'm' with
any non-alpha character you wish. If you wish to eliminate the
border all together, use 'm0'. The resulting menu will be only
slightly larger than the text.
+ Join Lines
The title and message text is separated from the menu options with a
single horizontal line. By default it does not touch the border.
With the '+' option, it can be joined to the border.
R#, C# Row, Column
To place the menu at a position other than centered on the screen,
the 'r' and 'c' switches will define the position of the upper left
hand corner. BATMNU will make adjustments to ensure the menu and
shadow, if used, will remain within the screen boundaries. BATMNU
will not confuse 'c' (centered) with 'c#', column #.
No_Margin No Wide Margin
If you prefer that the menu does not have the large margin around
the menu, use the "no_margin" keyword to eliminate it. This will
increase the Title and Option line maximum length to 60 and 56
respectively. It the menu is in 2 column format, the max option
length is 28.
5
Documentation
─────────────────────────────────────────────────────────────────────────
Popup Save/Restore Screen Contents
You have the option to save the entire screen before BATMNU displays
the menu, and restore the saved contents after the menu closes.
Include the keyword "popup" on the "window" line to make this
happen. Cursor position is saved as well.
No_Bar No Highlight Bar
If you want the type of menu that just uses hotkey option selection,
put this keyword on the "window" line. It should be noted that this
option cannot be combined with 'HINV' since the user would have no
way of knowing how to pick an option. Whichever option appears last
on the line will be used. Also note that option help is of no use to
a menu with no highlight bar (See "2.6 Option Help", p. 7).
2.4 Other Window Options
─────────────────────────────────────────────────────────────────────────
There are five other options for the window line:
x - disables the mouse. No search is performed.
p# - Screen Saver Pause
v#[var] - Option Return Value
~ - Allows use of the Escape key to exit menu, returns EL 0
auto_help - Extended help window displayed as option is highlighted.
X No Mouse
Use 'x' if you do not want to use the mouse. The mouse check is
skipped when the program starts and there is no delay in activating
the menu. This option has no effect on systems without a mouse.
P# Screen Saver Pause
'p' controls the pause time before the Screen Saver activates. The
default is 5 minutes. The Screen Saver can be disabled with 'p0' and
the maximum setting is 30 minutes (p30).
V#[var] Option Value Return
Information about the option chosen can be returned through the
environment by using the 'v' option. It extracts a portion or all of
the option's text and can be used for a number of things. Its format
is "v#var" where # controls the number of characters to return (1-
60) and var is the variable name to use. If the variable name is not
specified, BATMNU will use "VAL". In retrieving the text, if # is
larger than the option's length, the entire option text is returned.
If you use the letter or number option, the label is skipped so that
just the option's text is placed in the environment. See the example
batch file, NORTONV.BAT, to see how this feature can be used to
eliminate "if errorlevel" statements and simplify the batch file.
NOTE: DOS 3.3 or higher is needed to use this feature.
6
BATMNU v2.4
─────────────────────────────────────────────────────────────────────────
~ Escape
Normally, ESCape is not a valid key for a menu. If you wish ESCape
to be active, place a '~' on the window line. Errorlevel 0 will be
returned. If the 'v' option is used, the environment variable will
be set to "ESC".
Auto_Help Automatic Extended Help
Placing this keyword on the window line will cause the Extended
Option Help window for an option to be displayed when the option is
highlighted. See section 2.6 Option Help for more details (p. 9).
2.5 Option Lines
─────────────────────────────────────────────────────────────────────────
As stated above, the format for the option line is:
option,Option Text,hotkey[,drive letter,directory,program params]
Hotkey position starts at 1 and will default to that position if omitted
or the number is longer than the text. Alternately, the hotkey can be
defined with a character. BATMNU will first search the option text for an
uppercase letter that matches. If there is no uppercase match, the
program will do a lowercase search for the first character that matches.
(e.g. "Disk Info,i" will highlight the I of "Info". "Disk Filer,i" will
highlight the i in "Disk".) Use a number if you want a specific character
as your hotkey.
If a hotkey character is duplicated, the menu will return the value
associated with the first option with that hotkey if the hotkey is
pressed. If the highlight bar is used to select an option with a
duplicate hotkey value, the highlighted option value will be returned.
You can let BATMNU select the hotkeys, if you wish, with the 'a' window
parameter. The choices can be overridden by the option line selection.
The menu will default to letter choices if it runs out of characters to
pick from. This procedure will also favor uppercase characters before
lowercase. To override this, use 'an' (auto hotkey, no case).
If the program cannot find any options in the file, a Menu Format Error
message will be displayed.
Refer to the section, Menus With Parameters (page 11), to see a
description of the drive, directory and program options.
2.6 Option Help
─────────────────────────────────────────────────────────────────────────
The Help line specifies text which will appear in the footer (See below.)
when the option is highlighted. It can be up to 70 characters long and
can appear with the time and date. This will restrict the help line
length some, depending on the time/date format used. The help must follow
7
Documentation
─────────────────────────────────────────────────────────────────────────
the option it refers to creating option/help pairs in the menu. e.g.
"option,Norton Commander" could be followed by "help,File Utility".
If you want more extended help for an option, use a label (up to 15
characters long) instead of just text. This type of line would have the
form "help,:NC". The colon marks 'NC' as a label. When the option is
highlighted, "Press F1 for Option Help" will appear in the footer. To
define your own prompt, follow the label with a comma and your prompt
text. For example, "help,:NC_Hlp,File Utility - Press F1 for more"
When F1 is pressed, BATMNU will read a section of the same file
containing the menu that starts with ":NC_Hlp" and ends with
":End_NC_Hlp". Between these two labels is information defining a help
window. It is defined similarly to the menu. There can be a "window" line
with any of the following switches: F# (window foreground color), B#
(window background color), T# (Title color), O# (Help Text color), M#
(window frame type), S# (shadow type), C (center help text), R# (row for
upper left corner), C# (column for upper left corner) and + (join title
separator to window frame).
All of these switches follow the same rules as described above in the
"2.2 Window Options" and "2.3 Window Appearance" Sections. As a default,
the help window will inherit the menu's values so you could skip the
"window" line entirely. C (center) and + (join) differ slightly in that
they will reverse the value inherited from the menu. If the menu's
options are centered and C is used on the help's "window" line, the help
text will NOT be centered. Likewise, if + appears in both the menu and
help, the menu's separators will be joined and the help separator will
not.
There is no "Title" line for help. The option text is used as the help
window's title.
As in the menu, the "window" line and help text can be indented for
better readability. The leading spaces will be ignored. If you want any
line of text appearing in the window to be indented, precede the line
with an underscore (_) for each space you want. This is interpreted by
Batmnu as a "hard space" and will not be disregarded. Only hard spaces
preceding the text will be converted. The following is an example of the
extended help window definition:
:NC_Hlp
window, fBLU, bwhi, tred, oblu, c
This program provides a great many file
and directory manipulation routines.
:End_NC_Hlp
This will result in a window with a white background, bright blue border,
red title, and centered blue help text (if the menu's options are NOT
8
BATMNU v2.4
─────────────────────────────────────────────────────────────────────────
centered). It will have a shadow identical to the menu's, assuming the
menu had one.
The extended help window can be configured to appear automatically as the
option is highlighted. Just add the key "Auto_Help" to the menu's window
line. For appearance's sake, it is suggested that the menu and help
windows be positioned (using R# and C#) so they don't overlap or at least
so the highlighted menu option is still visible. It should be noted that
the help is read from the menu file each time the option is highlighted
as a way to conserve memory. Some delay may be noticed on slower systems.
IMPORTANT NOTE: Help, simple or extended, is not displayed when a menu
has no highlight bar. (See no_bar, p. 6)
2.7 Headers and Footers
─────────────────────────────────────────────────────────────────────────
Header and Footer format lines (h_format, f_format) have the following
options:
f# - Text Foreground color (0-15)
b# - Text Background color (0-7)
t# - Display time of day (0-4)
d# - display today's date (0-5)
Popup - show text while menu is displayed only
The header and footer items define a line of text to appear at the top
and bottom of the screen. The entire row will be colored with the
background color.
F#, B# Foreground/Background Color
Colors are defined on the h_format and f_format lines using the f#
(foreground) and b# (background) parameters as shown above. Refer to
Window Options on page 2 for more information on colors.
T#, D# Time and Date
The time and date can appear in the header and / or footer. On the
format line(s) include a 't' for time and 'd' for date followed by a
number indicating the format to use. They are as follows:
TIME DATE
0 - HH:MM:SS (default) 0 - MM/DD/YY (default)
1 - HH:MM:SS am 1 - MM/DD/YYYY
2 - HH:MM am 2 - DDD MMM DD, YYYY
3 - HH.MM.SS 3 - DD/MM/YY
4 - HH.MM 4 - DD/MM/YYYY
5 - DDD DD MMM YYYY
The date will appear to the left of the header or footer and the
time will appear to the right. If the header/footer is too long, the
9
Documentation
─────────────────────────────────────────────────────────────────────────
time and date information could overwrite it. A footer can be
combined with help (See above.) with the help text given precedence.
If an option has no help line, the footer text is displayed.
Popup Save/Restore Header and Footer Line
Another option for the f_format and h_format lines is the keyword
"popup". Normally, the header and footer lines remain after the menu
selection is made. If you want either or both of these lines to
disappear with the menu, include the keyword "popup" on the
appropriate format line. Their appearance will be the same when the
menu is displayed, however, they will disappear, restoring the
original lines, or the menu background if k# was used (p. 3), when
the menu closes.
3.0 WHAT HAPPENS IN THE BATCH FILE?
─────────────────────────────────────────────────────────────────────────
If you execute the sample batch file, NORTON.BAT, you will see a menu
displaying several choices. If you choose one of the options, you will
probably see a lot of DOS error messages as the chance of your computer
being set up the same way is negligible. When you view the batch file,
you can get a good idea how BATMNU operates.
The menu is near the beginning of the batch file mainly for speed. You
will notice a "GOTO START" statement which causes the batch to branch
around the menu. After the ":START" label is the command line that calls
BATMNU and tells it what file the menu is in. If this file is not in your
PATH or in the current directory when started, you would need to specify
the full path name. e.g. BATMNU D:\UTIL\NORTON.BAT
DOS ERRORLEVEL is set on exit from BATMNU with EL 1 corresponding to the
first option, etc. A series of "if errorlevel x goto ..." statements
after the line calling BATMNU will allow the batch file to determine
which option was selected and branch to the appropriate label. EL 127 is
set whenever the program encounters an error (file not found or parameter
error) so you should plan your batch file accordingly. If the Escape key
option is used, this will always return an EL 0. Be sure to order your
errorlevel statements from largest to smallest since "if errorlevel 3"
will be true for EL=3 or greater. See your DOS manual for more
information.
Executing BATMNU with no parameter will display a help screen and example
menu if the file BATMNU.HLP, included in the original archive file, can
be found (See the Appendix for more info on this file). If you type the
command "BATMNU NORTON.BAT" from the DOS prompt, the menu will be
displayed as before but nothing will happen when you make a choice. You
need to run the batch file itself to get anything to start. Several
example files are contained in this archive, including one showing a
separate menu file, another a menu within a batch file, and a third
detailing a menu with parameter passing.
10
BATMNU v2.4
─────────────────────────────────────────────────────────────────────────
4.0 MENUS WITH PARAMETERS
─────────────────────────────────────────────────────────────────────────
Optionally, a program can be started directly from BATMNU. This will
result in shorter batch files as minimal ERRORLEVEL checking is
necessary. You will also find the programs will start faster since there
is no batch file processing. The option line contains additional
information relating to the drive, directory and program name is this
form:
option,Word Perfect,w,c:,\wp51,wp
In this example, BATMNU will change the drive and directory and start WP
when this option is selected. When WP is finished, you are returned
directly to your batch file. BATMNU sets an environment variable, ERRLEV,
to identify the program run. You may wish to do further processing based
on the program run or you can check for an ERRORLEVEL code returned from
that program. The ERRLEV variable will equal the number of the option
picked. If WP was the third option, ERRLEV=3 would be in the environment.
You could then run an automatic backup procedure for WP with the line "if
%ERRLEV%!==3! goto wpbackup".
Additional parameters can be passed to your program. Simply include them
after the program name as you normally would.
option,Paradox - Phones,11,e:,\paradox\phones,paradox3 phone.scr
This line would start Paradox which would then run the script phone.scr.
It is recommended that your batch file clear the ERRLEV variable at the
beginning and end to preserve space and prevent your batch file from
acting on old information in the environment. The statement "SET ERRLEV="
will do this.
If there are no parameters on a line, you can use BATMNU the same way as
earlier versions and the ERRLEV variable will not be set. If you want to
leave out the drive and/or directory parameters, leave a comma to mark
it. BATMNU will assume the program can be found in your PATH. If you
don't use any parameters for an option, the placeholders are not
necessary. See the files NORTONP.BAT and NORTON.BAT in this archive for a
comparison.
If you want the highlight bar to be on the option you just selected after
returning, the ERRLEV variable can be used on the command line to set the
default option. The command:
BATMNU NORTONP.BAT %ERRLEV%
will do this. Refer to the example file NORTONP.BAT to see how this is
set up.
11
Documentation
─────────────────────────────────────────────────────────────────────────
IMPORTANT NOTE: DOS 3.3 or higher is required if you want to use
parameters on the option lines. This is necessary so that BATMNU can use
the environment to relay information back to the batch file. BATMNU will
display an error message and return an EL 127 if you are not using the
proper DOS version.
5.0 MOUSE SUPPORT
─────────────────────────────────────────────────────────────────────────
When BATMNU is run, it checks for a mouse unless the 'x' parameter is
found on the "window" line. This switch will cause BATMNU to skip the
check for, and not use, the mouse. Once the mouse is detected, the mouse
cursor will be set next to the first option. The delay you will observe
after the menu is displayed and before the highlight bar appears is the
mouse initializing and is normal.
Options can be selected with the mouse by moving the cursor to the option
line and clicking the left button. If the option is currently
highlighted, BATMNU acts as if the hotkey was pressed. If not, only the
highlight bar is moved. A second click will then select that option.
The right mouse button acts like the ESCape key if the ~ option is used.
6.0 SCREEN SAVER
─────────────────────────────────────────────────────────────────────────
If you use BATMNU for a shell, you will appreciate this feature. As a
default, if the program does not see any key presses or mouse clicks in a
5 minute period, the screen will blank to protect your display. Only the
cursor will show in the upper left hand corner. Press any key or mouse
button to restore the screen.
The pause time before blanking is set on the Window line with the 'p'
parameter. 'p0' will disable this feature and the maximum pause before
blanking is 30 minutes.
7.0 SHAREWARE INFORMATION
─────────────────────────────────────────────────────────────────────────
This program is provided as "shareware". You are allowed to use it, free
of charge, for a reasonable amount of time. If you find BATMNU to be
useful, and continue to use it, a registration fee of $15 plus $2.50
postage and handling is required. A form is supplied with the archive
file to register with (BATMNU24.REG). Paying this fee will encourage me
to make improvements and/or correct problems for future versions.
Registered users will receive notification of future releases and
information on how the new version can be obtained. It will also give
their ideas for improvements more value.
Site licenses for BATMNU can be negotiated. Registered 1.X users can
upgrade to 2.4 for $5 plus $2.50 for postage and handling. Feel free to
give it to friends or upload the original archive file to other BBS's
12
BATMNU v2.4
─────────────────────────────────────────────────────────────────────────
provided that no fee is charged for distribution and it is not modified
in any way. Note to BBS Sysops: Please post this archive file as is, with
all files included, and without changing the filename.
7.1 New Security Version
─────────────────────────────────────────────────────────────────────────
If you have trouble with people messing with your menu files, BATMNU is
now available in a version which will read specially encrypted files. The
encryption scheme will not fool the CIA, but it should keep curious
people from playing with your menu files.
This new version, called BATMNU-E, has all of the features of the regular
program and is completely compatible with it. It will read straight text
files as well as the encrypted ones. The program which does the
encrypting (and decrypting for editing) is included with BATMNU-E and is
very simple to use.
If you want to receive BATMNU-E and the companion encrypting program, the
cost is $15. Use the form provided to register either or both.
7.2 New Utility Available
─────────────────────────────────────────────────────────────────────────
WHY DO USERS LIKE A MENU?
Because it makes their life easier. Now there is something to make the
menu designer's life easier! Now creation of the menu is taken out of
your hands and onto the screen!
The BatMnu Menu Utility makes creating menus fast and painless. It gives
instant feedback on what your new menus will look like. Debugging the
most sophisticated menu is now a chore of the past. Seasoned BATMNU
users quickly find they wouldn't be without this utility.
Now updated with the features of Batmnu v2.4, it's available to all
registered BATMNU users. Why do you need this? LOOK!
- See your menu as you are creating it. Instant feedback on changes
and additions. The menu has the same look and feel it will have
with BATMNU.
- No need to remember which switch does what.
- Menus are created just by filling in forms, answering a few Yes/No
questions or selecting values from a list.
- Automatic formatting of the menu file.
- Menus can be edited even if they are inside batch files.
- Up to 16 menus from the same file can be edited at one time.
- Rearranging options is as easy as highlighting the option and
pressing a key.
13
Documentation
─────────────────────────────────────────────────────────────────────────
I know you will want the easiest way to create and edit menus for BATMNU.
The BatMnu Menu Utility will make menu maintenance as easy as filling in
a form. Use the registration form (BATMNU24.REG) to order BMU with your
registered version of BATMNU. It's just $10 if you order with BATMNU. If
you decide to order later you will have to pay an additional $2.50 for
postage and handling. Get your copy today!
7.3 Bonus Program!
─────────────────────────────────────────────────────────────────────────
Upon receipt of the registration fee, a disk will be sent with the
current version plus the program SW-DIR.EXE. This program provides a
scrolling file directory which can be used to choose a file and pass that
filename to an application or use it in your batch file. Appearance
options are similar to BATMNU. The program includes a QuickSearch feature
which can quickly locate a file by name. DOS 3.3 or higher is required to
use this program.
Ver. 2.4 October 11, 1994
Warren Small CIS 71076,407
35 Benjamin Street AOL WKSmall
Manchester, NH 03109-4319 Internet wksmall@aol.com
Prodigy RSJW31A
8.0 BATMNU History
─────────────────────────────────────────────────────────────────────────
1.1 2/02/90 First general release.
1.2 3/15/90 Options increased to 26. Added automatic hotkeys (A, p. 5)
and hotkey choice by letter (p. 7).
1.3 4/22/91 Added numbered options (N, p. 5), menu frame choices (M#,
p. 4), invisible hotkeys (INV, p. 3).
2.0 9/30/91 New option line format to start programs directly (p. 11).
Added mouse support (p. 12), screen border color control (E#, p. 3),
screen foreground color control (K#, p. 3), header and footer option
(p. 9), shadow position control (S#, p. 4), letter and number
separator (L, N, p. 5).
2.0a 1/31/92 Maintenance release fixing several bugs. Parameters now
passed properly to programs started by BATMNU. Border color set
properly. Default colors provided for header and footer. Header and
footer documentation provided.
2.1 6/30/92 Added time/date options to header and footer (T#, D#, p.
9). Header and footer string length increased to 70 (p. 9). Default
menu choice can be specified on command line (p. 1). Corrected
action of menu with duplicate hotkeys (p. 7). Hotkey selection by
14
BATMNU v2.4
─────────────────────────────────────────────────────────────────────────
letter favors uppercase match in option text (p. 5). Option string
length increased to 50 for single column menus. Help line option
added (p. 7). Background string fill added (K#string, p. 3).
2.1a 9/22/92 Environment variables can be used in title, header, footer,
options and help (p. 2). ESC now clears help line (p. 7).
2.2 1/11/93 Right mouse button used as ESC (p. 12). Screen Saver added
(P#, p. 12). Help now in external file (p. 16).
2.3 10/29/93 Added row/col positioning for menu (R#, C#, p. 5), option
to remove wide margin around menu frame which increases title and
option maximum length (p. 5), popup style header and footer (popup,
p. 10), popup mode for the entire screen (popup, p. 6), and option
value return through environment (V#[var], p. 6). Default 2 column
menu now occurs at 14 instead of 12. Menu errors now return EL 127
instead of EL 0. Encryption version now available (p. 13). BatMnu
Menu Utility now available (p. 13).
2.3a 2/15/94 Added message line to bottom of menu (msg, p. 2), custom
border and borderless options (m, p. 5), and option to join
title/msg separators to border (+, p. 5).
2.4 9/30/94 Added extended option help (p. 8), highlight bar color
(Bar-, p. 3), and no highlight bar (no_bar, p. 6) Mouse cursor now
placed next to default option (p. 1). New help file format matching
Extended Option Help (See Appendix).
15
Documentation
─────────────────────────────────────────────────────────────────────────
APPENDIX
─────────────────────────────────────────────────────────────────────────
BATMNU 2.2 and higher use an external file for help information. The
advantage to this is that it makes the program file smaller and it also
allows a certain amount of customizing by the end user. The following is
a guide to the structure of the help file, BATMNU.HLP.
Beginning with Batmnu v2.4, the help file has been modified to follow
the same format as the extended option help described in section 2.6.
Each section begins with a label such as ":W_Colors" and ends with a
matching label, in this example, ":End_W_Colors".
On the next line is the "window" line which defines what the window will
look like and where it will be placed. Batmnu calculates the size of the
window based on the strings following the window line and before the end
label. Continuing with the above example, "W_Colors", here is the section
from BATMNU.HLP:
:W_Colors
window, r11, oYEL, tRED, fWHI, +
__These switches define the menu colors:
f - Foreground Color b - Background Color
t - Title/Msg Color o - Option Color
h - Hotkey Color k - Screen Colors
:End_W_Colors
The window's first line is row 11 (r11), the title is bright red (tRED),
the help text is bright yellow (oYEL), the window border color is bright
white (fWHI) and the title separator is joined to the border (+). The
underscores (_) in front of "These..." are hard spaces. They are neces-
sary to indent the line in relation to the others. Batmnu ignores leading
spaces otherwise.
If you decide you want to alter or add to the information in the file,
here are a few things to remember.
- The window should start at row 8 or more and end at row 22 or less
unless you don't care if it covers the other text on the screen. In
that instance, it can extend from row 1 to 25. The background text
is not disturbed in any case.
- The labels cannot be altered. These are hard coded into BATMNU at
present. If changed, the program would not be able to find the help
section.
- Make sure that, if you add strings to a section, you adjust the
window's beginning row accordingly.
16