Qbasicnews.com

QBasic => QB Discussion & Programming Help => Topic started by: zoasterboy on November 10, 2006, 07:23:43 PM



Title: How do you use function keys in QB?
Post by: zoasterboy on November 10, 2006, 07:23:43 PM
How do you use function keys, to use with the if command?


Title: How do you use function keys in QB?
Post by: Anonymous 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 ^^*


Title: How do you use function keys in QB?
Post by: zoasterboy on November 12, 2006, 01:09:54 AM
Sw3333t thanks.