home *** CD-ROM | disk | FTP | other *** search
- DEFINT A-Z
-
- ' QB Menu routine based on Steven E. Skindell's routine
- '
- ' Stephen C. Lenz
- ' 380 Morris Avenue
- ' Providence, RI 02906
- ' CIS 72431,3147
-
- MaxNum = 13
-
- DIM CAP$(1 TO MaxNum), ID$(1 TO MaxNum), ID(1 TO MaxNum)
-
- FOR X = 1 TO MaxNum
- READ ID$(X), ID(X)
- FL$ = FL$ + MID$(ID$(X), 2, 1)
- CAP$(X) = " " + MID$(ID$(X), 2, 1)
- NEXT
-
- Reference = 1 'Starting Point of numbered command
- LineNumber = 25 'Y Axis start line
-
- StartHere:
- CLS
-
- LOCATE 10, 1
- PRINT "Use the right/left arrow keys to move the cursor bar then press ENTER -or-"
- PRINT "press the Highlighted letter next to the command to execute."
- PRINT "Press 'q' to Quit ..."
-
- GOSUB GetMenu
-
- CLS
-
- IF Reference = LEN(FL$) THEN CLS : PRINT "Done!": BEEP: END
-
- COLOR 7, 0
- PRINT "You selected : ";
-
- COLOR 15, 0
- PRINT MID$(FL$, Reference, 1); " ("; Reference; ")"
- PRINT
- PRINT
-
- COLOR 7, 0
- LINE INPUT "Press Enter..."; bb$
-
- GOTO StartHere 'notice the previous command is highlighted (reverse video)
-
- GetMenu:
- IF Reference > MaxNum THEN
- Reference = 1
- ELSEIF Reference < 1 THEN
- Reference = MaxNum
- END IF
-
- GOSUB MainMenu
-
- GOSUB GetMenu2
-
- RETURN
-
- GetMenu2:
- DO
- Aj$ = INKEY$
- LOOP WHILE Aj$ = ""
-
- IF Aj$ = CHR$(27) THEN CLS : END
-
- IF Aj$ = CHR$(13) THEN RETURN
-
- Aj$ = UCASE$(Aj$)
-
- IF INSTR(FL$, Aj$) > 0 THEN
- Reference = INSTR(FL$, Aj$) 'starting letter of command
- GOSUB GetMenub
- RETURN
- END IF
-
- DoAgin:
- IF (LEN(Aj$) = 2 AND RIGHT$(Aj$, 1) = CHR$(15)) OR (LEN(Aj$) = 2 AND RIGHT$(Aj$, 1) = CHR$(75)) THEN
- Reference = Reference - 1
- GOTO GetMenu
- ELSEIF (Aj$ = CHR$(9)) OR (RIGHT$(Aj$, 1) = CHR$(77) AND LEN(Aj$) = 2) THEN
- Reference = Reference + 1
- GOTO GetMenu
- END IF
-
- GOTO GetMenu2
-
- GetMenub:
- IF Reference > MaxNum THEN
- Reference = 1
- END IF
-
- IF Reference < 1 THEN
- Reference = MaxNum
- END IF
-
- GOSUB MainMenu
-
- RETURN
-
- MainMenu:
-
- FOR X = 1 TO MaxNum
- LOCATE LineNumber, ID(X)
- COLOR 7, 0
- PRINT ID$(X);
- LOCATE LineNumber, ID(X)
- COLOR 14, 0
- PRINT CAP$(X);
- NEXT
-
- COLOR 0, 15
-
- LOCATE LineNumber, ID(Reference)
- PRINT ID$(Reference);
-
- COLOR 7, 0
-
- RETURN
-
- DATA " Add ",2," Browse ",7," Calc ",15," Delete ",21
- DATA " Edit ",29," Find ",35," Keys ",41," Next ",47
- DATA " Opt ",53," Prev ",58," Rep ",64," Save ",69," Quit ",75
-
-