ADDRESS null
OPTIONS 'TRAP'
SIGNAL ON HALT
SIGNAL ON SYNTAX
SIGNAL ON ERROR
CALL RXERR('ERROR|DISPLAY')
rxtype.1 = 'TEXT'
rxflags.1 = 'NOBORDER'
rxlabel.1 = "Press a key on the keyboard:|"
rxpos.1 = '1 10 1 0 0'
rxtype.2 = 'TEXT'
rxflags.2 = 'NOBORDER'
rxlabel.2 = '|'
rxpos.2 = '1 10 20 198 0'
rx = ''
CALL RXCREATE('RX', 2, 'Main Window', 'NOCLOSE|KEYS|TAB')
DO FOREVER
CALL RXMSG()
IF rxid == '' THEN SIGNAL HALT
IF DATATYPE(rxid, 'NUM') == 0 THEN DO
text = ""
IF LEFT(rxid, 1) == 'A' THEN text = 'ALT '
IF SUBSTR(rxid, 2, 1) == 'C' THEN text = text || 'CTRL '
IF SUBSTR(rxid, 3, 1) == 'S' THEN text = text || 'SHIFT '
IF LENGTH(rxsubid) == 1 THEN DO
IF rxsubid = ' ' THEN rxsubid = 'SPACE'
END
text = text || rxsubid
CALL RXSET(,'VALUE', text, 2, 1)
END
END
syntax:
CALL RXSAY(CONDITION('D') || '0D0A0D0A'x || SOURCELINE(sigl),,'Error '||condition('E')||' at line '||sigl)
halt:
error:
CALL RXMSG(, 'END')
EXIT
|