Get Switch Character





QuickBasic


' DOS 2+ - SWITCHAR - GET SWITCH CHARACTER

'$INCLUDE: 'qb.bi'

DIM inregs  AS RegTypeX
DIM outregs AS RegTypeX

inregs.ax = &H3700

' DOS interrupt with sub-function &H37

CALL InterruptX(&H21, inregs, outregs)

IF outregs.FLAGS AND 1 THEN
   PRINT "Error getting switch character"
   BEEP: END
END IF

DIM Switch AS STRING
Switch = CHR$(outregs.DX AND 255)

PRINT "Switch Character: "; Switch