Contents of the MENU.DOC file

MENU.BAS gives you the power of LOTUS style menus in yourown Quick-Basic 4.0 programs. It gives you multiple level menus. Up toten levels are supported and more could be added if neccessary. MENU.BAS remembers the last item selected from any menu andhighlights that item when reentering a menu. Menu colors can be setby the programmer. This set of routines greatly simplifies menuing byreducing the amount of code that you need to generate. Only two callsto subroutines are necessary.

To automate menuing in your programs you need to set up amenu file as an INCLUDE file like the one below from the demoprogram. Note the format, the first DATA is the number of items inthe list - 1. Next is the row where you want to place the menu, thenthe column. The fourth item begins the actual menu items.

menu1: DATA 3 'The number of items in the menu - 1 DATA 1 'the row to place the menu DATA 1 'the column to place the menu DATA Overview, 7, 0, overview of MENU.BAS DATA Address, 7, 0, how to get in touch with me DATA Disclaimer,7, 0, IMPORTANT DATA Quit,7,0,end the program

menu3: shows the format of a menu symbolically. Follow thisformat when setting up data statements.

# the number of items in the menu - 1row the row to place the menucolumn the column to place the menuitem the name of the menu itemfcolor the foreground colorbcolor the background colordescription a breif description of the item

Your menu list should include all the line labels from menu1: tomenu10: These are neccessary because MENU.BAS expects them to bethere and will return an error if they are not. Your file should benamed "menu.lst". This is the name that MENU.BAS will search forwhen compiling.

The calling sequence is simple

CALL setmenu(menuno, enter, alone)

menuno the number of the menu you want to use.

enter are you entering this menu from a lower level, or returning from a higher level. 1 for entering from lower level. 0 for retruning from higher level.

alone should this menu be displayed by itself? 1 will turn off other menus. 0 will leave other menus on.

To get an item from the menu use the following format

x = getchoice(choice)

The variable "choice" will contain the ascii code of the itemselected. Your program can then act on the value of choice in aSELECT CASE structure or an IF THEN structure. Getchoice alsomanages the light bar and allows selection of a menu item by either thecursor and return keys or by pressing the first letter of the item. The demo program is short but provides an excellent axample ofhow to use these routines. I suggest that you use the format presentedfor calling subroutines using a SELECT CASE structure inside a DOLOOP.

One last thing, your program must have the metacommand:

'$INCLUDE: 'menu.def'

located at the beginning. This includes the declarations for usingMENU.BAS. Thats all you need to use this slick menuing routine. Justfollow the steps below.