home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / library / qb_pds / bassub / menukey.bas < prev    next >
Encoding:
BASIC Source File  |  1987-10-18  |  637 b   |  20 lines

  1.  
  2. '   Subprogram to get a keypress and compare it against
  3. '   a string passed in MKey$, looping until there is a match.
  4.  
  5.     SUB MenuKey(MRow%,MCol%,MKey$) STATIC
  6.  
  7.         LOCATE MRow%,MCol%,1                            ' turn on cursor
  8.         MK$ = ""
  9.         DO WHILE MK$ = ""                               ' get keypress
  10.             MK$ = INKEY$
  11.             IF INSTR(MKey$,MK$) < 1 THEN                ' check for match
  12.                 MK$ = ""                                ' reset variable
  13.                 SOUND 1000,1:SOUND 1500,2:SOUND 500,1   ' alarm if no match
  14.             END IF
  15.         LOOP
  16.         LOCATE ,,0                                      ' turn off cursor
  17.         MKey$ = MK$
  18.  
  19.     END SUB
  20.