Category : Files from Magazines
Archive   : PJ91.ZIP
Filename : MENUKEY.PRG
* Author: M. Steven Baker
private m_row,m_col
notfound = .T.
DO WHILE notfound
IF (remenu)
@ 23,0 CLEAR to 24,79 && clear menubar area
@ 23,3 SAY menuline
IF (menusel <1 .OR. menusel > menu_max)
menusel = 1
ENDIF
SET COLOR TO N/W
@ 23,VAL(SUBSTR(menubar(menusel),1,2)) ;
SAY SUBSTR(menubar(menusel),3,LEN(menubar(menusel))-2)
SET COLOR TO W/N
@ 24,3 SAY menuhelp(menusel)
ENDIF
badkey = .T.
DO WHILE (badkey)
choice = 0
DO WHILE (choice = 0)
choice = inkey()
ENDDO
m_row = row() && save cursor position
m_col =col()
@ 0,60 CLEAR to 0,78 && clear error line at top
@ m_row,m_col SAY "" && restore cursor position
IF (choice >32 .AND. choice <127) && an ASCII char?
choice = UPPER(CHR(choice))
m = 1
DO WHILE (m <= menu_max .AND. badkey)
IF ( SUBSTR(menuchoice,m,1) = choice)
notfound = .F.
badkey = .F.
menusel = m
ELSE
m = m+1
ENDIF
ENDDO
ELSE
badkey = .F.
DO CASE
CASE choice = 4 && right arrow
IF (menusel < menu_max )
menusel = menusel +1
ELSE
menusel = 1
ENDIF
choice = SUBSTR(menuchoice,menusel,1)
CASE choice = 19 && left arrow
IF (menusel = 1)
menusel = menu_max
ELSE
menusel = menusel - 1
ENDIF
choice = SUBSTR(menuchoice,menusel,1)
CASE choice = 13 && return
choice = SUBSTR(menuchoice,menusel,1)
notfound = .F.
CASE choice = 32 && space bar - advance right
IF (menusel < menu_max )
menusel = menusel +1
ELSE
menusel = 1
ENDIF
choice = SUBSTR(menuchoice,menusel,1)
CASE choice = 9 && tab key - advance right
IF (menusel < menu_max )
menusel = menusel +1
ELSE
menusel = 1
ENDIF
choice = SUBSTR(menuchoice,menusel,1)
OTHERWISE
badkey = .T.
notfound = .T.
ENDCASE
ENDIF
ENDDO && do while(badkey)
ENDDO && while notfound
RETURN
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/