home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Boldly Go Collection
/
version40.iso
/
TS
/
17A
/
DMMENU10.ZIP
/
MENU.DOC
< prev
next >
Wrap
Text File
|
1989-04-01
|
19KB
|
411 lines
MENU PROGRAM C Version
1. INTRODUCTION
This program was designed to make IBM-compatible computers
friendlier by allowing you to run programs from a simple menu
-- without having to type lengthy DOS commands. This program
essentially allows you to enter DOS instructions once and they
will be stored in a file for future menu selection.
This version has been placed in the public domain by its
author, John Queern. Thanks to Bob Sutter for providing user
documentation and an enhanced Pascal version (which is
available as shareware).
1.1 System Requirements. Operation requires an IBM-compatible
computer with at least 256K of memory and DOS 2.1 or higher.
The program is especially helpful with fixed-disk systems.
1.2 Basic Operation. The systems uses the DOS Batch facility
extensively. The program is started by entering "MENU" which
starts a batch file which will in turn execute the main
program, "MENUDRV," then execute the batch file that is created
-- "MENULOAD." As long as the last entry in "MENULOAD" is
another call to the batch file "MENU," the sequence will
continue until a file is called that does not chain back to
MENU. The main menu may also contain "submenus" as desired. As
indicated in the tree structure below, the menus and programs
can be intermixed and "stacked" to allow for a more structured
system operation.
┌─────────────┐
│ Main Menu │
│ │
└──────┬──────┘
┌────────────────┴───────────────┐
┌────────┴────────┐ ┌────┴────┐
│ Individual │ │ Other │
│ Programs │ │ Menus │
│ │ └────┬────┘
│ 1 - Program 1 │ ┌───────────┴─────────┐
│ A - Program A │ ┌───┴────┐ ┌─────────┴─────────┐
│ B - Menu B │ │ Other │ │ Individual Menu B │
│ C - Program C │ │ Menus │ │ Programs │
│ X - Exit to DOS │ └───┬────┘ │ │
└─────────────────┘ │ │ B - Program B1 │
┌──────────────┴───┐ │ D - Program D1 │
┌────────┴──────────┐ ┌─────┴────┐ │ X - Return to Main│
│ Other Individual │ │ Menus │ └───────────────────┘
│ Programs, etc. │ │ Etc. │
└───────────────────┘ └──────────┘
2.0 PROGRAM OPERATION
2.1 Program Initiation. The menu program is started by typing
"MENU" which invokes the batch file "MENU.BAT." This file
should be created as listed in one of the samples in Appendix
B. As a minimum, it should call the main program MENUDRV and
then call the batch file MENULOAD. Additionally, if the menu
programs are all loaded on a different subdirectory, there
should also be instructions to change to that directory first
(e.g. CD\UTILITY\MENU). Once the program is started, the main
menu that was selected by the parameter will appear on the
screen. A sample screen is in Appendix D. The calendar will
have the current day highlighted, and any days in the current
month that are located in the holiday or special files will be
highlighted in different colors or shades (if video card is
capable).
2.2 Adding or Editing Menu Items. At the bottom of each menu,
the F1 key indicates that you may add or edit an item. This
applies to the items on the current menu only. To adjust an
item on another menu, select that menu first. If adding a new
item, you will first be asked if the item is another menu. Your
response should be "N" (unless you plan to create a
submenu--see section 2.3). Then a work window will appear,
allowing you to give the item a name, and list the instructions
to be executed.
2.2.1 Batch-executed Programs. Batch files can be created by
entering the lines exactly as they would be if you were
creating a batch file that would run from DOS. See appendix C
for a list of the editing commands. Options can be substituted
in the batch file at selection time by use of square brackets
([]s). Anything you place inside of the brackets will be
displayed on the screen, and the response typed in will replace
all that is enclosed by the brackets when the batch file is
written. For example, if the menu line contains:
EDLIN [File to Edit?]
The menu program will first prompt the user with "File to
Edit?" If you respond with "ABC.DOC" then the actual line in
the batch file will become "EDLIN ABC.DOC" -- giving you quite
a bit of versatility.
The last line in the list should normally be "MENU x" where "x"
is the submenu you want to display upon returning to the menu
after the program selected is complete. You should also note
that other batch files should not appear in the list, since
they will then have control, and a return to MENU will not
occur "automatically."
When you have completed your changes or additions, press Ctrl-
W, and the data will be updated in memory and control returned
to the menu. Now when that item letter is selected from the
menu, the related batch lines will be written to the file
"MENULOAD.BAT," and the program will exit. By exiting, the
"old" batch file "MENU.BAT" resumes control, which will then
invoke the new batch file "MENULOAD.BAT." Under DOS, starting
another batch file will terminate the current batch file, even
if there are instructions not yet executed.
2.2.2 Programs Executed While Menu Program Stays Resident.
MENUDRV has the capability to "terminate and stay resident"
while your selected program is executed. This speeds up the
execution of the menu, since the program must save files and
restart from the beginning each time when called from the batch
files. Several restrictions apply when using this option. Each
command line must start with an ampersand ("&"). Also, the
entire executable file string must be listed, including the
drive and path, if appropriate. (Example: C:\UTIL\MAP.COM).
Only "com" and "exe" files may be executed with this option.
However, you can call "command.com" to execute .BAT files or
DOS internal commands like this:
&C:\COMMAND.COM /C CD \MYDIR
The "/C" argument tells COMMAND.COM to "execute the command
which follow, then return." Which means it can be anything you
would type in at the DOS prompt.
Upon termination of the selected program, control will be
immediately returned to MENUDRV, speeding up the menu process.
Note that this option should only by used for programs that
will fit in the memory which remains after the menu is loaded.
If all available memory is needed (such as in LOTUS 123), you
should not use this option, but use the option in 2.2.1 above.
2.3 Adding or Editing Menus. The F1 option also allows you to
edit or add another menu selection (the description of the menu
and the menu's "letter.") Initially, the same questions as
above will be asked, except you should respond "Y" if asked if
it is another menu. Then a window will appear allowing you to
add/edit the description of the menu and the menu letter to
transfer to. You must also assign a menu letter. It is easiest
to have the item letter the same as the menu letter, but since
you can have many items on different menus with the same
selection letter, it may not be possible to have another menu
with the same letter, since each menu must have a letter unique
letter. (NOTE: The main menu is referred to as menu "M").
When creating a new menu, one item will automatically be
created for you - "X - Exit to DOS." After selecting the new
menu, this item can also be edited and changed if desired. Note
that the last line in that selection will not contain a call to
MENU, which causes control to return to DOS. Also note that the
same letters may be used to refer to items in different menus,
but each menu itself must have a unique letter for reference,
which effectively limits the total number of menus in the
system to 36 ("A" through "Z" and "0" through "9"), although
some punctuation may also be used if necessary.
2.4 Deleting Items and Menus. The F2 option at the bottom of
the screen allows deletion of a menu item on the displayed
menu. After asking for the item letter, you will be asked for
confirmation that you want to delete that item. CAUTION: If
deleting a menu item that selects another menu, be sure that
you first go to the sub menu and delete all of the items on
that menu before deleting the menu itself. Otherwise, all of
the sub-items will remain in the data base, assuming you are
going to use them on another menu of the same code option.
NOTE: This deletion occurs only in the memory table until you
exit the program by running a batch job or select exit. At that
time all the changes you have made to the options will be saved
to the default directory in file MENU.DAT.
2.5 Setting Colors. The F4 option on the menu selects another
window that allows you to select different color options for
the program. Simply typing one of the colors listed at the
bottom of the window will reset the parameters. NOTE: On EGA
cards (e.g. Zenith 248), the bright colors will cause the
screen to blink where that color is selected. The parameters
will be saved automatically as the program is exited.
2.6 (alarm and chime features are not present in the C version)
2.7 Help Screens. Help screens are available for most of the
functions. Once you have a basic understanding of the menu
system, the help menus should be all that you need. The key
that will invoke the help screen is displayed on each screen
that has help available.
2.8 Exiting Program. Exiting the program is normally done in
two ways -- by selecting an item on the menu that uses a batch
file that does not contain a return call to menu, or by typing
the "END" key. During the exit process, all the information on
the items, menus, and parameters that had been in memory and
were changed, will now be written to the appropriate disk files
on the default drive. NOTE: If you are running the menu system
from a ramdisk, ensure you have a routine that copies all the
changes that you make to the "DAT" files are copied to the disk
for permanent storage (e.g. use XCOPY, etc.)
2.9 Executing/Running Programs. Selecting a menu option from
the menu being displayed simply creates a batch file named
MENULOAD.BAT containing the DOS instructions you gave it when
creating/editing it. Once this batch file is created, the
MENUDRV program terminates. This in turn returns control to
DOS, which realizes that the original batch file MENU.BAT is
still in control. The next instruction in that batch file
should be MENULOAD, which then transfers control of the batch
mechanism to MENULOAD, effectively terminating the MENU.BAT
file. Then the instructions contained in MENULOAD are executed
sequentially, with the last instruction being a call to
MENU.BAT, restarting the program.
Programs that are in the data file preceded with an ampersand
("&") are not written to a batch file. Instead, MENUDRV
executes a "terminate and stay resident" instruction and
transfers control to the requested program.
4 SETTING YEARLY DATES
The calendar on the menu program screen will not only highlight
the current day, but can also be configured to highlight two
other sets of dates in two different colors/shades. These sets
are contained in the files "YEAR.HOL" and "YEAR.SPC". Although
the names indicate "holiday" and "special," they can be used
for any purpose. The data is entered using any ASCII line
editor (EDLIN may be the simplest.) If using word processors
such as Wordstar or Wordperfect, be sure you save the files as
DOS text files, not in the programs' unique format.
4.1 Holiday File. This file (YEAR.HOL) contains a chronological
list of the months and days for the current year's holidays. It
must be updated each year as the dates change. The format is mm
dd xxxxxx where mm is the numeric value of the month, dd is the
day, and xxxxxx reflects any comments that you may have to make
the entry more readable for the next person who reviews it. The
comments are not reflected anywhere else except in the file,
and are therefore optional. Sample entries may be as follows
(note at least one space between each entry):
1 1 New Years
7 4 July Fourth
12 25 Christmas
4.2 Special File. The special file (YEAR.SPC) can also contain
dates to be highlighted on the calendar. Such events as
birthdays or anniversaries may be listed. The format is the
same as above, except they will show up as a different
color/shade on the calendar.
4.3 Program Operation. There is a special program "YEAR.COM"
(in the Pascal section) which will display an entire year's
calendar, highlighting the current day, and any days contained
in the above two files. The dates will be highlighted only if
the year selected is the current year. This program is a
simple, handy way of looking at an annual calendar, and may
also be selected from the menu program, if desired. Since this
program does not update any files, it may be executed using the
"terminate and stay resident" option of the menu program,
speeding up the return to the menu.
APPENDIX A - Program Files
MENU.BAT - The batch file controlling the execution of the
menu program. See Appendix B for examples for setting up this
file.
MENUDRV.EXE - The main menu program. It requires up to 80K of
memory to operate. The program accepts one parameter -- the
letter of the menu to initially display on the screen. If no
parameters are specified, it will load menu "M" (the main
menu.)
MENU.DAT - The listing of all the menu options the user has
specified. The format is in the form:
m,s,i Descrip,batch [,batch]
where the "m" indicates the name of the menu, the "s"
indicates the submenu this item will invoke ("*" means none),
and the "i" indicates the item letter to appear on the screen.
"Descrip" is the description that appears after the item
letter on the screen. The DOS batch commands that are to be
executed are then listed, separated by commas. "Continuation
records" start with an "&". Updating this file is most easily
done by the "F1" option in the program itself, or for the
brave and confident, can be created/updated with any text
wordprocessor.
YEAR.EXE - This program displays an annual calendar of the
year selected.
YEAR.HOL·····-·This file contains dates to be interpreted by
the menu program and YEAR program as holidays.
YEAR.SPC·····-·This file contains dates to be interpreted by
the menu program and YEAR program as special dates.
APPENDIX B - Sample MENU.BAT Files
The most basic MENU.BAT must contain the following three
entries:
echo off
MENUDRV %1
MENULOAD
Another sample for executing from a hard disk subdirectory:
echo off
C:
CD\util\menu
MENUDRV %1
MENULOAD
A sample of executing from a RAMDISK subdirectory, ensuring
any changes to the data files are copied to the fixed disk
(adjust parameters for your version of DOS):
echo off
if exist D:\MENU\MENUDRV.COM goto ok
md D:\MENU
copy C:\UTIL\MENU\*.* D:\MENU>NUL
:OK
d:
cd\menu
attrib -a *.dat
MENUDRV %1
xcopy d:\menu\*.dat c:\util\menu /a
MENULOAD
APPENDIX C - Basic Editing Commands
There is an attempt to use "standard" editing commands while
on the screen to input the changes to the batch file listings
when using option "F1". The commands generally follow
Wordstar-type commands. A "^" before the key indicates that
the "CTRL" key should be held down while depressing the
following key. See the on-screen help screens for additional
information.
Home Goto line 1 column 1
PgUp, ^r Goto top of screen
PgDn, ^c Goto bottom of screen
End, ^w Save changes and exit
Ins, ^v Toggle the insert/overwrite mode
Del, ^g Delete one character
^y Delete one line
^z Blank screen
^t Delete word right
^a/^f Advance word left/right
^qs/^qd Goto beginning/end of line
^n Insert a line