home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
progm
/
qlib.zip
/
XMEN.BAS
< prev
next >
Wrap
BASIC Source File
|
1991-01-28
|
3KB
|
71 lines
DECLARE FUNCTION MENU% (A$)
DECLARE FUNCTION MENINIT% ()
DECLARE SUB CLMENU ()
DECLARE SUB LDMENU (A$)
DECLARE SUB MENFO ()
DECLARE SUB TITLE (A$,B$,C$,N%)
TITLE "XMEN - Menu Demo","Ver. 01.00.00","1990",0
CYC: IF N%=0 THEN N%=MENINIT% ' If no menu items then initialize
I%=MENU%("MENU DEMO PROGRAM") ' Run menu screen
IF I%=66 THEN N%=N%+1 ' If input B then increment items
IF I%=27 THEN GOTO XIT ' Exit if ESC
IF I%=65 THEN ' Print info screen if A
MENFO
ELSEIF I%=66 AND N%<=20 THEN ' Add item if B and items < 20
IF N%=3 THEN ' Load clear prompt if C
LDMENU "Clear Menu To Two Items"
ELSE ' Load item # prompt if > C
LDMENU "Item Number"+STR$(N)
END IF
ELSEIF I%=67 THEN ' Clear and set items to 0 if C
CLMENU
N%=0
ELSEIF I%=>66 AND I%<=84 THEN ' Print key push message
CLS
LOCATE 13,30
PRINT "You Pressed ";CHR$(I%);
BEEP
SLEEP 1
END IF
GOTO CYC
XIT: CLS
END
FUNCTION MENINIT% ' Create basic two item menu
LDMENU "Menu Information"
LDMENU "Increase Menu List"
MENINIT%=2
END FUNCTION
SUB MENFO ' Print menu info screen
CLS
LOCATE 4,1
PRINT STRING$(80,178)
DO
READ A$
IF A$<>"END" THEN PRINT USING "▓▓ \"+SPACE$(70)+"\ ▓▓";A$
LOOP UNTIL A$="END"
PRINT STRING$(80,178)
PRINT
COLOR 0,7
PRINT " ANY KEY TO RETURN TO MENU ";
A$=INPUT$(1)
RESTORE
END SUB
DATA ,"This program demonstrates the MENU sub routine by using a sample menu to"
DATA "show how you can expand or decrease a menu in your applications through"
DATA "program instructions."," "
DATA "The decrease command in this demo clears the menu and reenters the first"
DATA "two menu items. In regular programs you can clear it and add any number"
DATA "of new items."," "
DATA "You can also write routines to selectively clear an item, however, this"
DATA "will not disable the display of the key cleared, nor the passing of the"
DATA "key value on input by the menu. If you selectively blank a key you must"
DATA "also write a routine in your program to deal with signals received from"
DATA "keys assigned to empty items.","","END"