OpenBCM V1.08-5-g2f4a (Linux)

Packet Radio Mailbox

IZ3LSV

[San Dona' di P. JN]

 Login: GUEST





  
ZL1ANM > QBASIC   30.07.08 23:18l 49 Lines 1452 Bytes #999 (0) @ WW
BID : ZL1ANM32
Read: GUEST
Subj: QBasic key id program
Path: IZ3LSV<IK2XDE<DB0RES<ON0AR<HS1LMV<CX2SA<ZL2BAU<ZL1AB
Sent: 080730/2212Z @:ZL1AB.#06.NZL.OC #:16476 [AUCKLAND] FBB7.00i $:ZL1ANM32
From: ZL1ANM@ZL1AB.#06.NZL.OC
To  : QBASIC@WW


REM Here's a QBasic program I wrote. It definitely runs in DOS 6.2.2
REM and DOS 7.0, and probably runs in earlier versions.

REM It prints onscreen the decimal value of any key pressed, including
REM the cursor keys, Alt- combinations, Ctrl- combinations, and F1-F12.
REM This is useful if you're writing a program in QBasic and need to 
REM know the code for any particular key combination.

REM As a bonus, the program shows how to use Alt-x (CHR$(0) + CHR$(45)) 
REM to exit.

REM Copy this bulletin into the directory where your QBasic program
REM lives (usually found in DOS directory since QBasic comes with DOS),
REM and rename it with a .BAS extension, such as KEYS.BAS. It will then
REM be found when you next run QBasic. After opening QBasic, select the
REM program, and press F5 in the usual way to run it.

REM All lines beginning with REM will be ignored by QBasic. You may
REM even delete them. Be sure to delete or REM any text that appears
REM after my 73 below.

REM ===================
REM program code begins:
CLS
PRINT "Type any key..."
PRINT "Alt-x to quit..."
PRINT
DO
 DO
 k$ = INKEY$
 LOOP WHILE k$ = ""
   FOR i = 1 TO LEN(k$)
   PRINT ASC(MID$(k$, i, 1))
   NEXT i
   IF k$ = CHR$(0) + CHR$(45) THEN
   SYSTEM
   END IF
LOOP
REM end of program code
REM ===================

REM 73 de Neil ZL1ANM

                                                                     T4 1.5à24


Read previous mail | Read next mail


 22.12.2024 11:40:46lGo back Go up