Dec 182017
Source code for Lotus style lightbar menus in QuickBASIC.
File LTBRQB4.ZIP from The Programmer’s Corner in
Category BASIC Language
Source code for Lotus style lightbar menus in QuickBASIC.
File Name File Size Zip Size Zip Type
DEMO1.BAS 4331 1396 deflated
DEMO1.EXE 41547 28227 deflated
DEMO1.MAK 21 18 deflated
DEMO1.OBJ 6871 3630 deflated
LTBRQB4.DES 588 343 deflated
MENU.BAS 5199 1239 deflated
MENU.DEF 645 291 deflated
MENU.DOC 3960 1561 deflated
MENU.LST 546 213 deflated
MENU.OBJ 5434 2902 deflated
TPCREAD.ME 199 165 deflated

Download File LTBRQB4.ZIP Here

Contents of the MENU.DOC file

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

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

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

DATA Next,7 , 0,show the next page
DATA Previous, 7, 0, show the previous page

DATA # of items - 1
DATA row
DATA column
DATA item, fcolor, bcolor, description
DATA item, fcolor, bcolor, description

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

# the number of items in the menu - 1
row the row to place the menu
column the column to place the menu
item the name of the menu item
fcolor the foreground color
bcolor the background color
description a breif description of the item

Your menu list should include all the line labels from menu1: to
menu10: These are neccessary because MENU.BAS expects them to be
there and will return an error if they are not. Your file should be
named "menu.lst". This is the name that MENU.BAS will search for
when 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 item
selected. Your program can then act on the value of choice in a
SELECT CASE structure or an IF THEN structure. Getchoice also
manages the light bar and allows selection of a menu item by either the
cursor and return keys or by pressing the first letter of the item.
The demo program is short but provides an excellent axample of
how to use these routines. I suggest that you use the format presented
for calling subroutines using a SELECT CASE structure inside a DO

One last thing, your program must have the metacommand:

'$INCLUDE: 'menu.def'

located at the beginning. This includes the declarations for using
MENU.BAS. Thats all you need to use this slick menuing routine. Just
follow the steps below.

1.) create the INCLUDE file "menu.lst"

2.) '$INCLUDE: 'menu.def' contains the program declarations

3.) CALL setmenu(menuno, enter, alone)

4.) x = getchoice(choice)

 December 18, 2017  Add comments

Leave a Reply