home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
db3util.zip
/
MENUDB3.EXE
/
lha
/
MENU1.PRG
< prev
Wrap
Text File
|
1985-08-03
|
4KB
|
130 lines
*MENU123.PRG
* set environment
CLEAR
SET TALK OFF
SET BELL OFF
SET DELIMITER OFF
SET PROCEDURE TO WINDOW
* store constants for window program
A=CHR(205)
AA=A+A+A+A+A+A+A+A+A+A
WDASH=AA+AA+AA+AA+AA+AA+AA+AA
STORE SPACE (79) TO WBLANK
STORE .T. TO MENUON
DO WHILE MENUON
CLEAR
* CREATE MENU ITEMS AMPLIFICATION WINDOW
ROWSSTART =2
ROWSEND = 4
COLSSTART = 0
COLSEND = 79
DO WINDOW
* display user directions message
STORE " [8] MOVE BAR "+CHR(24)+" " TO MSG1
STORE " [2] MOVE BAR "+CHR(25)+" " TO MSG2
STORE " [X] TO EXIT " TO MSG3
STORE "("+CHR(17)+CHR(196)+CHR(217)+")"+"SEL MENU ITEM " TO MSG4
CLEAR GETS
@ 23,2 GET MSG1
@ 23,20 get MSG2
@ 23,38 get MSG3
@ 23,56 get MSG4
CLEAR GETS
*set window borders for menu
ROWSTART = 07
ROWSEND = 13
COLSSTART = 28
COLSEND = 47
* set number of items
NBR_ITEMS = 5
DO WINDOW
* set menu items for later placement in menu window
STORE "MENU SELECTION 1 " TO C10
STORE "MENU SELECTION 2 " TO C11
STORE "MENU SELECTION 3 " TO C12
STORE "MENU SELECTION 4 " TO C13
STORE "RETURN TO DBASE " TO C14
@ ROWSSTART+1,COLSSTART+2 SAY C10
@ ROWSSTART+2,COLSSTART+2 SAY C11
@ ROWSSTART+3,COLSSTART+2 SAY C12
@ ROWSSTART+4,COLSSTART+2 SAY C13
@ ROWSSTART+5,COLSSTART+2 SAY C14
*
* lite bar scroll/menu select program
STORE 1 TO CNTER
STORE NBR_ITEMS TO MDECISION, NBR
* initialize lite bar loop controls
STORE ROWSSTART + 1 TO ROWSTRT, ROWCURR, ROW
STORE COLSSTART + 2 TO COL
* set row position for cursor control
STORE ROWCURR TO ROW
* loop to move light bar
DO WHILE NBR > 0
@ 3,1 SAY SPACE(78)
DO CASE
CASE CNTER = 1
@ 3,1 SAY "Amplification of menu item 1"
CASE CNTER = 2
@ 3,1 SAY "Amplification of menu item 2"
CASE CNTER = 3
@ 3,1 SAY "Amplification of menu item 3"
CASE CNTER = 4
@ 3,1 SAY "Amplification of menu item 4"
case cnter = 5
@ 3,1 SAY "EXIT TO DBASE"
ENDCASE
*SET variables to save user selection
STORE "C" + STR(CNTER + 9,2) TO X
STORE "X" + STR(CNTER + 9,2) TO S
STORE CHR(16) TO &S
@ ROW,COL GET &X
CLEAR GETS
@ ROW,COL-1 GET &S
READ
@ROW,COL-1 SAY " " + &X
DO CASE
CASE &S = "2"
IF CNTER < NBR_ITEMS
ROW = ROW + 1
CNTER = CNTER + 1
ELSE
STORE ROWSTRT TO ROW
STORE 1 TO CNTER
ENDIF
CASE &S = "8"
IF ROW # ROWSTRT
STORE ROW - 1 TO ROW
STORE CNTER - 1 TO CNTER
ELSE
STORE ROWSTRT + (NBR_ITEMS - 1) TO ROW
STORE NBR_ITEMS TO CNTER
ENDIF
* item selected
CASE &S = chr(16)
store cnter to mdecision
STORE 0 TO NBR
* EXIT DESIRED
CASE &S = "X"
CLOSE PROCEDURE
CLEAR ALL
RETURN
ENDCASE
STORE ROW TO ROWCURR
ENDDO
DO CASE
CASE MDECISION = 1
do tester
CASE MDECISION = 2
DO MENUSEL2
CASE MDECISION = 3
DO MENUSEL3
CASE MDECISION = 4
DO MENUSEL4
CASE MDECISION = 5
CLOSE PROCEDURE
CLEAR ALL
CLEAR
RETURN
ENDCASE
ENDDO