Dec 092017
 
Menu maker program that can be used within a batch file for making customized menus, prompt messages, and user interaction within a batch file.
File BATM.ZIP from The Programmer’s Corner in
Category Batch Files
Menu maker program that can be used within a batch file for making customized menus, prompt messages, and user interaction within a batch file.
File Name File Size Zip Size Zip Type
BATMENU.DOC 10013 3375 deflated
BATMENU.EXE 16151 9558 deflated
SAMPLE1.BAT 440 151 deflated
SAMPLE1.MNU 541 301 deflated
SAMPLE2.BAT 400 152 deflated
SAMPLE2.MNU 373 217 deflated

Download File BATM.ZIP Here

Contents of the BATMENU.DOC file









BATMENU.DOC

(c) Copyright 1989, James L. Tucker, all rights reserved,
except as stated below.

BATMENU.EXE is a copyrighted program. The right to copy this
program and its support files is granted for non commercial
use, provided that the program and the support files are kept
together and are not modified in any manner.

This program is placed into the public domain "as is." It
includes no warranty or guarantee that it will operate on
your computer, or is appropriate for your use. It is a
powerful addition to the usefulness of batch files.
Experimenters and Power Users will find many ways to build
batch files with interactive input to start their favorite
application, or select which group of TSR's they may wish to
load in their AUTOEXEC.BAT.

This is a menu maker program that can be used within a batch
file for making customized menus, prompt messages, and user
interaction within a batch file. To specify what prompts are
to be displayed, and what keys will cause the program to
exit, the user must state these parameters in a definition
file. Many definition files may be created. Which one to be
used is specified on the command line of the program. A file
extension .MNU is assumed if no extension is stated. For
example, to run the sample menu definition file, include in a
batch file the line:
BATMENU SAMPLE1

Examine the sample batch files SAMPLE1.BAT, and SAMPLE2.BAT
for examples.

When the program BATMENU is started, it examines its
environment to find a mouse. If no mouse is found, it
defaults to the keyboard mode. If a mouse is found, and the
mouse driver has been installed, then BATMENU defaults to its
mouse mode. The keyboard mode can be forced, even when a
mouse is present by including the phrase "/nomouse" after the
definition file name. To force the keyboard mode, run the
program from a batch file with the command line:
BATMENU SAMPLE1 /NOMOUSE

To create and display a menu, a menu definition file must be
created. Sample menu definition files are provided as
SAMPLE1.MNU and SAMPLE2.MNU.

Each line in the menu definition file has a meaning and a









syntax. The correct syntax must be observed for correct
operation. The first line must contain 6 numbers. The first
two are screen coordinates for the placement of help messages
that accompany each of the menu entries. The first is a row
number in the range of 0-24 (25 available rows), and the
second is a column number in the range 0-79. The next four
specify the colors that will be used. There are four colors,
to be specified in this order-normal characters, normal
background, enhanced characters, enhanced background.
Specify the colors with these numbers:

characters and background characters only, not available
in background
0 black 8 gray
1 blue 9 light blue
2 green 10 light green
3 cyan 11 light cyan
4 red 12 light red
5 magenta 13 light magenta
6 brown 14 yellow
7 white 15 bright white

Include the numbers only, using spaces between them, (i.e.)
24 0 7 0 0 7
will specify, in this order:
row 24 for help messages
column 0 for help messages,
white letters on black for the normal display
reverse video (black on white) for the enhanced display

All remaining lines in the definition file are grouped into
pairs. The line pairs may be separated from other pairs by
blank lines for readability, if desired. This is not
necessary, however. No blank lines are allowed between the
lines within a line pair. Each pair of lines defines one
entry in the menu being created. The first line of each pair
takes the form:

row/col/prompt/key

which has the following meaning:

row-the row position of the prompt, within the range 0-24

col-the column position of the prompt, range 0-79

prompt-the prompt text

key-This is a single key entry that causes this particular
entry to be selected. If no key is specified, then this
particular prompt definition will be treated as a title,

2







or a permanent help message. It will be displayed, but it
will not be included as a highlighted menu choice.
Examine the SAMPLE1.MNU and SAMPLE2.MNU files and
experiment with them to understand this.

All three of the / delimiter characters must be included,
even when no key entry is included.

The second line of each definition line pair is the text for
the help message that is associated with this particular menu
entry.

All lower case key entries and keyboard entries are converted
to upper case within the program.

Include BATMENU within a batch file. BATMENU will return to
the batch file the key character associated with the selected
menu entry when it terminates. Use the IF ERRORLEVEL command
within your batch file to act on which menu entry was
selected. Examples of this technique are the accompanying
batch files SAMPLE1.BAT and SAMPLE2.BAT.

For your convenience, I have included a list of possible key
characters you may choose to use, along with the number that
BATMENU will return to the batch file.

0 48 > 62 L 76
1 49 ? 63 M 77
2 50 @ 64 N 78
3 51 A 65 O 79
4 52 B 66 P 80
5 53 C 67 Q 81
6 54 D 68 R 82
7 55 E 69 S 83
8 56 F 70 T 84
9 57 G 71 U 85
: 58 H 72 V 86
; 59 I 73 W 87
< 60 J 74 X 88
= 61 K 75 Y 89
Z 90

I am very anxious to learn if this is useful for anyone. If
you have any compliments, bugs, complaints, or comments,
please send me a note at 2920 Sonata Drive, Quincy, Illinois,
62301.






3







Tips and tricks

In this section, I will ramble a bit about some of the
problems that people have asked me to help them deal with in
using this program. Hopefully, discussing them will help you
avoid the same errors.

1. The best way to tailor a menu file for your use is to copy
one of the sample .MNU files I provided, then edit it to suit
your needs. Any text editor that creates pure ASCII files
(with no hidden control codes) should work fine. This will
include programmers text editor and note taker utilities.
Some word processors do not qualify, and some word processors
must be configured. If you have no other alternative, you
can always use the EDLIN.COM line editor that came with your
disk operating system.

2. When creating your batch file, always place your series of IF
ERRORLEVEL ## commands in descending order. This is
necessary because the ERRORLEVEL ## is evaluated as true if
the code returned by BATMENU is equal to or greater than the
##.

3. If you have a Hercules Graphics Adapter, you may have trouble
with some of your color selections yielding unexpected
results. This is because the graphics adapter forces the
background to be black if the foreground is anything but
black. So, a bright white display on a blue or red
background will appear the same as a bright white display on
a black background. As a consequence, the color choices in
the SAMPLE1.MNU are not usable. Use the color sequence of
7 0 0 7 for best results.

4. There is one additional feature that you may find handy.
You may enter the one letter menu selection characters as
soon as you hear the "beep-beep" during boot up. It is not
necessary to wait until you see the menu on the screen. The
entered character will be stored in the keyboard buffer, and
the BATMENU program will find and use the data immediately.
This little trick can speed up your boot up process slightly.












4




 December 9, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)