home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mega CD-ROM 1
/
megacd_rom_1.zip
/
megacd_rom_1
/
MENU
/
BMS_7_21.ZIP
/
BMS.DOC
< prev
next >
Wrap
Text File
|
1987-07-21
|
27KB
|
578 lines
Bob's Menu System - Rev. 07/21/87 - Documentation
******************* Recent changes *****************************
This version fixes some trivial little things that weren't quite
'bugs', but which were mildly annoying. You can now use the
single key selection method with items which begin with numbers.
If you choose to set the color of the 'dimmed' menu items to a
reverse video attribute, the reversed part of the item name will
now be spaced out evenly. The delay before the screen protect
routines kick in has been increased to about 5 minutes, and is
now optional. The system automatically determines if screen-
flicker avoidance in necessary, by checking the EGA bios area for
the presence of the 'IBM' characters. If not found, the color card
is assumed to be an CGA. Selections which begin with space characters
can now be selected with the single key method.
****************************************************************
******************* BUG FIX ************************************
A bug existed in some previous versions which caused some serious
problems for people using DOS 2.xx. It seems that earlier
versions of DOS don't handle file attributes the way later
versions do. The Makemenu installation utility in the older
versions set Menu.bat to read-only and hidden when creating it.
This works fine with recent DOS versions, but apparently the
batch interpreters in the earlier versions can't read these
files. My apologies to anyone who had problems due to this
oversight...
*****************************************************************
This menu system allows having anywhere from 1 to 240 items
available without a complicated system of sub-menus having to be
defined. Just create a simple text file listing the items, as
described below, run the install program, and you have a good
looking menu devoid of annoying copyright messages. You can
include a password for any item, and can specify how each item
should be executed.
There are 3 methods of executing selections:
1) BATCH METHOD: When an item of this sort is selected, the
menu program exits to DOS with the error code set. The main
batch file (Menu.Bat) then resumes control and executes the
instruction which corresponds to the error code. When done
executing, control returns to DOS - and the Menu.Bat file is
run again, either by the application batch file or manually,
to restart the menu.
2) SHELL METHOD: When the item is selected, the menu program
(Bms.Com) loads a secondary copy of the command processor,
with the argument set to the name of the command or
application. As soon as the selected item finishes
executing Bms.Com regains control, optionally pausing for a
keypress before taking over the display.
3) DIRECT METHOD: The menu program (Bms.Com) invokes the
selected item directly without first loading another command
shell. This has most of the advantages of the Shell Method,
but additionally saves a bit of memory.
Each of these methods has it's advantages and disadvantages, and
the last one (Direct) will only work under certain conditions.
The following is an outline of how to choose the best method for
a given application:
- The Batch Method will work for ANY application, and is the
most efficient in terms of memory. This is the default
method.
- The Shell Method will work for almost any application
provided there is enough memory left over for it after the
Bms.Com program and the secondary command shell have taken
what they need. On my machine, I have 512K - and DOS takes
up 52K. With Bms.Com and a secondary command shell in
place, there is 127K used - and the remainder is available
for applications. The 'almost' is because you clearly
shouldn't use this method to load TSR's (memory resident
programs). More on that later...
- The Direct Method will ONLY work for applications which do
not require access to any of the DOS internal commands or
functions. You cannot directly invoke DIR, for example, or
do redirection or piping. You cannot directly invoke a
batch file, since the batch interpreter is part of the
command processor (doing so will require a Ctrl-Alt-Del if
you're lucky - the Off switch if you're not). You have to
give the FULL path and name of an .EXE or .COM file: e.g.,
\db3\dbase.exe. Using this method is slightly faster, and
slightly more memory efficient, than the Shell Method.
Again, don't use this method for TSR's.
I recommend using the Batch method predominantly. Having the
extra memory free is quite important, and the batch method isn't
THAT slow. I would use the shell or direct methods for small
applications, or for setting up specific applications in areas
where security is an issue. You obviously don't want people to
be able to Control-C their way out of batch files when you're
concerned about security.
See below (Command Options) for details of how to use each
method.
Let's talk in more general terms for a minute. We'll get back to
the technical end in a bit...
The menu system provides a way of displaying and executing all
applications running on PC compatible systems. The actual menu
seen by the user will be a moderately standard 'moving bar' type
- with selections being made with arrow, home and end keys or by
pressing the first letter of the selection. You can have
anywhere from 1 to 240 selections on a given menu, with PgUp and
PgDn being used to switch between pages of 60 items each. Each
item can optionally be protected with it's own password, as can
the ability to exit from the menu with the Esc key. Pressing any
incorrect key will, optionally, sound a short beep.
The process of creating a menu requires that you first position
yourself in the directory where you want the menu to reside.
It's assumed that a hard drive is being used. (You could run the
menu on a floppy system, but why bother?) You should copy the
files Bms.Com and Makemenu.Com to this directory.
Having done that, you'll now need to create an ASCII Source Text
file, which will be read by the Makemenu.Com installation
utility.
Create the Source Text file as follows:
Type a 21 char. max line which contains the application name that
you want the user to see. If you want a password to protect the
item, follow the name with a comma and a 60 char. max password.
Do not include spaces before or after the comma. An example line
would look like this:
WordPerfect 4.1,password
On the very next line (no blank lines allowed), you should type
the 64 char. max command that will be executed if the user
selects this item. It will normally be the name of a batch file
(assumed to be in the current directory or in the path, or
preceded by the pathname), or, if the Shell or Direct Method is
used, the name of a command appropriate to those methods.
Continuing the above example, if our WordPerfect batch file were
named wordperf.bat, then the entire two line entry would appear
as follows:
WordPerfect 4.1,password
wordperf
Adding a second item (SideKick, with no password, using the batch
file skick.bat) would then result in this:
WordPerfect 4.1,password
wordperf
Load SideKick
skick
NOTE: If you want to load TSR's like SideKick,
etc., from the menu, make sure you use the
default Batch Method. You'll end up with all
kinds of bozo things happening if you use
either of the other methods, since there will
be a 'hole' in memory as soon as the menu
terminates.
Now let's add an item to be executed using the Shell Method.
Remember, this will load a secondary command shell - and allow us
to give any command that we normally could at the DOS prompt.
We'll add an option to run Norton's Sysinfo.Com program, with the
password 'This is my new password':
WordPerfect 4.1,password
wordperf
Load SideKick
skick
Norton Sysinfo,this is my new password
+sysinfo
The + sign tells Bms.Com to execute this item using the Shell
Method, and to wait for a keypress after the program concludes
(so we have time to read everything before the menu takes over
the screen again). Note that you can also use a '&' instead of
the '+', if you don't want the keypress pause. See Command
Options, below.
Let's add one using the Direct Method (Bms.Com executes it
WITHOUT loading a secondary command shell). We'll add a program
called Setprint.Com, which resides in the \utils directory, and
we won't give it a password:
WordPerfect 4.1,password
wordperf
Load SideKick
skick
Norton Sysinfo,this is my new password
+sysinfo
Setup Printer
$\utils\setprint.com
The $ character tells Bms.Com to execute this item using the
Direct Method, and that we don't want to pause after it's done
executing. Note that we had to spell out the command name in
detail. You can also use a '-' instead of the '$', in case you
do want to pause for a keystroke before the menu takes over. See
Command Options, below.
Let's add one more Direct method item, the ability to exit to DOS
leaving the menu in memory as a shell. You'll need to know the
location of your command processor to do this, so I'll use mine
on the assumption that it's a standard setup.
WordPerfect 4.1,password
wordperf
Load SideKick
skick
Norton Sysinfo,this is my new password
+sysinfo
Setup Printer
$\utils\setprint.com
Command Shell,dos
$\command.com
All we've done here is tell Bms.Com to load and run a secondary
copy of the command shell, which is called Command.com and
located in the root directory, with the password 'dos' protecting
the option. You would return to the menu by typing either EXIT
or MENU. Note: Menu.Bat executes an EXIT command just prior to
running Bms.Com, to prevent multiple layers of command shells
from being built up. This last option we added is almost totally
useless, but it gives the menu system a way of opening a 'Dos
Window' just like the real programs do. Whoopee.
Keep alternating lines like this, giving the message you want the
user to see, an optional comma and password, and a second line
containing the command you want carried out if that item is
selected:
Prompt,Password
Command to be executed
Remember, using the Batch file method is the most foolproof, and
is the default unless you add either a &/+ or a $/- to the
command. Think of the '&' and '+' signs as meaning 'plus the
command shell'.
-----------------------------------------------------------
Command Options - Summary (plus one new one)
To use the Batch Method: - Either use no prefix, or prefix the
command with '='. The equal sign
prefix is to allow for the
possibility that you may have a
filename that begins with one of
the other prefix characters, and
want to make sure it's executed
with the batch method.
To use the Shell Method: - Prefix the command with '&' if you
want the menu to take control the
instant the application is done.
Use '+' if you want the menu to
wait for a keypress before it
clears the screen and takes over.
To use the Direct Method: - Prefix the command with '$' for no
pause, or '-' for a pause after the
item concludes.
If you're confused by the 'pause' thing, imagine running DIR/W
with the Shell method (remember, you can't run an internal DOS
command with the Direct method). The DIR routine would begin
executing, listing filenames on the console. When it had
completed, it would terminate. The split second it terminated,
however, the menu would flash back onto the screen. You would
have roughly a hundredth of a second to ponder the list. With
the pause option, a small message saying 'Press Any Key' would
appear on the bottom line - giving you time to read the results
before returning to the menu. Try it both ways! For a pause,
use +dir/w. For no pause, use &dir/w.
If you're confused by the equal sign '=' trick, imagine trying to
execute a batch file called '$Earned.Bat'. The initial '$' in
the name would cause Bms.Com to execute it as a Direct command,
causing the whole system to go out to lunch in spectacular style.
To force Bms to run it in Batch mode, prefix it with an equal
sign as in '=$Earned'. Now it will be run correctly in Batch
mode.
IMPORTANT: Remember not to put any spaces either between the
prefix and the command or surrounding the comma delimiter for
passwords. Also, do not include any blank lines.
------------------------------------------------------------
We could add a few more little touches to this, but it's actually
ready to use now. Save the file (remember that it must be in
ASCII text format), then run the Makemenu utility program. It
will ask you for the name of your Source Text file (whatever name
you used when you saved it), give you a few simple options to
select from, and then create the two files you need, Menu.Bat and
Menutext.Bms. The Menu.Bat file is the main batch file you will
always run to start up the menu.
Additional details
Having gotten to this point, we can talk about some additional
details that you might find helpful. If you have any commands
that you want to have executed every time the menu is run, you
can include them in your Source Text file by putting them at the
top and preceding them with an asterisk *. For example, let's
modify our example file by including a line to set the path each
time the menu is run:
*path=c:\menu;c:\utils;c:\dos
WordPerfect 4.1,password
wordperf
Load SideKick
skick
Norton Sysinfo,this is my new password
+sysinfo
Setup Printer
$\utils\setprint.com
Command Shell,dos
$\command.com
The Menu.Bat file would then issue this path command prior to
running Bms.Com. You can add as many such lines as you need,
e.g., to run a batch file which prints a message to the user, to
set the time/date, etc.
I suggest that you include a path statement to set the path to
include the directory the menu resides in. Then, it's a simple
matter to have your application batch files chain back to the
menu by adding the line MENU to the end of each one. It also
makes it easier for new users to run the menu - they don't have
to worry about what directory they're in...
You can, of course, edit your Source Text file and run Makemenu
as many times as you like. It's also useful to have multiple
Source Text files, and use Makemenu whenever you want to change
the menu. Makemenu is very fast, so it only takes a second.
Notes on the Makemenu utility program
If you are re-installing the menu in a given directory, Makemenu
will read the previous configuration data and give you the choice
of using the same values for the new menu. NOTE: if you are
currently using one of the earlier versions of the menu system,
you may or may not receive the message that the defaults have
been read -depending on how recent your version is. If you do,
choose N)o and install the system manually the first time.
If you choose not to use the same values, or if this is the first
install in the given directory, Makemenu will ask you for the
name of the Source Text file you created, and present you with
some Yes/No questions about how you want the menu configured.
There are currently only 6 such questions:
- Require Password for exit to DOS? Answer Y)es if you want
users to be required to enter a valid password before being
able to exit to Dos by pressing the <ESC> Key. If you
select password protection, you will later be asked to enter
the password. Note that whenever the menu requires a
password, a window will open and the 'please enter your
password' prompt will be displayed. Characters won't be
echoed to the screen, for obvious reasons.
- Enable Item Locking option? If Y)es, users will only be
allowed three 'guesses' at an item's password. Three
failures will result in the item no longer being accessible
until the menu is reloaded (e.g., after another item has
been run in Batch mode, or the menu is terminated and then
restarted). This is simply to discourage people from trying
repeated guesses at a password they don't know. The exit to
dos option will not be locked out regardless of the setting
of this option.
- Return to Root Directory on Exit? Answer Y)es if you want
to always return to the root when the menu system is exited.
- Beep On Error Condition? Select Y)es if you want a short
beep whenever an incorrect key is pressed.
- Show Allocation Size? Selecting Y)es will cause the menu to
be displayed with the file allocation (cluster) size noted.
You may want to suppress this if it's confusing to new
users. It's merely informational...
- Protect Screen Phosphor? Selecting Y)es will cause the menu
to shift into a screen-protect mode after about 5 minutes of
keyboard inactivity. This mode will prevent burn-in of the
screen by displaying a 'Press any key' message which jumps to
random screen locations every few seconds.
If you are running a video adaptor board in other than mode 7
(monochrome), Makemenu will next allow you to select attributes
(colors, etc.) for 6 different parts of the menu. The prompt
asking for the attribute will be displayed with the attribute
which is currently set for that part. You can mess around all
you want, because there is an option which automatically resets
all attributes to the default (the way it was when you got the
menu). Pressing Return at each of the 6 prompts will accept the
current value (that is, the value of the prompt itself). You can
generate some pretty ugly menus with this feature!
Makemenu will finally inform you that it is creating the files
Menu.Bat and Menutext.Bms, or will indicate an error if one
occurs.
At this point, assuming you didn't get any error messages, you
can run the Menu.Bat file by typing MENU and hitting the Enter
key. Test each option, to make sure your individual batch files
are working correctly. Again, note the suggestion of setting the
path to include the directory containing the menu system, and of
including the MENU command as the last instruction in each batch
file so the menu system will be re-started after each application
is run.
Obviously, the individual batch files which will be called by the
menu system must be correct. If you find that the system is
executing the wrong item (that is, not the one you selected),
there is probably a problem with the batch file associated with
the selected item.
TECHNICAL NOTES
The utility program Makemenu.Com reads in the Source Text file
(created by you), and generates the files Menu.Bat and
Menutext.Bms. Menu.Bat contains batch instructions to test for
the Dos error code returned by Bms.Com (the actual menu program),
and to execute the appropriate command (usually the name of
another batch file). Menutext.Bms contains the information used
by Bms.Com to display the menu screen. This includes the menu
prompts and corresponding passwords, and various of the menu
options set with the Makemenu utility. This file is
superficially encrypted. The encryption algorithm is extremely
simple, in the interest of speed. It's enough to stop amateurs,
but don't rely on it to provide serious security if there are any
programmers around.
Bms.Com and Makemenu.Com both set the numlock status bit to
cursor mode. This is expected to be found in the byte at
0000:0417h. Both programs also write directly to video ram,
which is assumed to start at either B000h or B800h. The programs
test to see which of these addresses to use. I didn't feel like
cluttering up the program with code to make video ram access
contingent on retrace mode, so there will be some flicker with
CGA boards. The Bms.Com program checks the 3 bytes starting at
C000:001Eh for the 'IBM' characters which, by widespread convention,
signal the presence of an EGA card. If the program has detected the
presence of a color card, and doesn't find that it's an EGA, the date
and time display routines will be set to suppress the seconds display.
This will prevent the menu from writing to the screen every second (and
causing flicker).
Bms.Com checks to see if the video mode has changed after each
item has executed. Hence, if you want to use one of the menu
selections to switch monitors, Bms will return with the correct
screen attributes for the current video mode.
For people using a network, the following points should be noted.
The screen can be manually restored by pressing Alt-S in case an
incoming message blows it away and fails to restore it. I don't
currently have access to any networked micros, so I haven't tried
writing code necessary to handle file and record lockouts.
Hence, there may be problems if multiple users happen to load the
menu or execute the same selection simultaneously. This is
unlikely, perhaps, but is certain to happen eventually. Perhaps
I'll release a 'Network Version' someday...
The limit of 240 menu selections is partly imposed by DOS, which
uses a single byte to store error return codes. The current
240 value represents 4 pages of 60 items each, which seemed like
a good round byteable number. Note that the system slows down a
bit if you use this many items in Batch mode. Batch files are
inherently slow, and the Menu.Bat file would have over 240
comparison instructions in it if the menu were used to capacity.
On an 8 mhz AT, this translated into a delay of 3 or 4 seconds
for the worst case item. Most people shouldn't need anywhere
near this number of selections on a menu. I considered having
the program simply create the batch file for each application as
the selection was made, but ruled it out for two reasons: The
file creation process would be slower for a typical small menu
(120 items or less), and this would increase the chances of
conflicts when run on a network. If speed is a problem, try
using the Shell or Direct methods described above, and note that
the first menu items are the last to be tested for in the
Menu.Bat file. Hence, you should put any Shell or Direct items
early in the menu.
NOTE: If you need vast numbers of selections, you should
simply install multiple menus in different directories.
A menu option on each would be used to load and execute
the other menu, by preceeding the MENU command with the
appropriate path. Do this using batch mode.
One small warning. Since Makemenu has no way of knowing a valid
source text file from an invalid one, most any file you name will
be accepted. This can result in some pretty strange menus,
especially if a binary file is read in until the first control Z
character! Make sure you give it a valid file...
Summary of Key Usage
The following lists all key commands available while the menu
system is running:
KEY EFFECT
--- ------
Enter Select the item currently highlighted
Arrows Move highlighted selection bar in direction of
arrow key. Wrapping will occur.
PgUp / PgDn Move to another page of the menu if there are more
than 60 items. Flashes page number indicator on
status line if not.
Home / End Move to first / last item on current page of menu
Esc Terminate menu system (normal exit to DOS)
Alt-S Re-write the menu screen if some network type task
intrudes
Ctrl-PrtSc Manually invoke the screen protection routine
First
Character
of any item Moves highlighted bar to that item, or to the next
item on the current page which begins with that
character (if multiples are present)
Any other
Incorrect
Key Either a short beep or no response depending on
setting of beep option.
Note that you don't have to worry about the setting of the
NumLock key, as Bms.Com holds this in cursor control mode while
running. Also, the screen protection routine will be called
automatically if there is no keyboard activity for a couple of
minutes. Pressing any key will restore the menu screen.
--------------------------
This may all seem a bit complicated on the surface, but anyone
who understands batch files should have no problem getting this
system running. I initially wrote this because there are
numerous new users where I work, and I needed a system that I
could quickly install and customize for each machine. It's
worked out extremely well, and people seem to have no trouble
learning to use it.
I THINK all the bugs are out of this thing, but please let me
know of any I may have missed. If you decide you like it and
want to use it, send me whatever you think it's worth. If you
don't want to spend any money, I'll settle for a letter
containing rave reviews...
Bob Trevithick
409 Woodhill Apts
Newark, New York 14513
GEnie address: R.TREVITHICK
Days (315) 331-1700 Ext. 2082
Evenings (351) 331-5266