Qbasicnews.com
November 20, 2019, 04:59:27 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How do you use function keys in QB?  (Read 2154 times)
zoasterboy
Guru
**
Posts: 295


Personal Text!


WWW
« on: November 10, 2006, 07:23:43 PM »

How do you use function keys, to use with the if command?
Logged

-yah
Anonymous
Guest
« Reply #1 on: November 10, 2006, 11:33:47 PM »

Code:
CLS
DIM keyIn AS STRING
DO
        DO
                keyIn = INKEY$
        LOOP UNTIL LEN(keyIn) > 0
        LOCATE 1
        PRINT "                             "
        LOCATE 1
        IF LEN(keyIn) > 0 THEN
                PRINT "chr$("; ASC(LEFT$(keyIn, 1)); ") ";
                IF LEN(keyIn) > 1 THEN
                        PRINT "+ chr$("; ASC(RIGHT$(keyIn, 1)); ")"
                ELSE
                        PRINT
                END IF
        END IF
LOOP UNTIL keyIn = CHR$(27)


run that, hit the key you want to know the code for, then do like 'var = inkey$' 'if var = <whatever code> then'

*adds another reason fb is better ^^*
Logged
zoasterboy
Guru
**
Posts: 295


Personal Text!


WWW
« Reply #2 on: November 12, 2006, 01:09:54 AM »

Sw3333t thanks.
Logged

-yah
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!