tips:revmedia:subs12

INPUT.CHAR

Published ByDateVersionKnowledge LevelKeywords
Revelation Technologies14 NOV 19892.XEXPERTINPUT.CHAR,

INPUT.CHAR is the fundamental subroutine in Advanced Revelation for processing keyboard input. INPUT.CHAR processes a single keystroke (or function key), returning only when a key is pressed. All keystrokes are processed except those defined as priority interrupts in @PRIORITY.INT (see Appendix 1, System Variables). User environment restrictions may also apply to certain keys. These are defined in @ENVIRON.SET (see Appendix 1).

INPUT.CHAR is also the basis for the indexing timeout loop, used to determine when background indexing is to occur.

key

An optional variable used by INPUT.CHAR to return the ASCII code for the keystroke entered by the user

If specified, key contains the ASCII coded keystroke. This is a two-character ASCII sequence (the initial value is 0) if a function key is pressed.

*Initialization 
DECLARE SUBROUTINE INPUT.CHAR,MSG 
 
*Display the ASCII code for the keystroke 
CHARACTER = '' 
IMAGE = '' 
MSG('Please enter a character:','UB',IMAGE,'') 
INPUT.CHAR(CHARACTER) 
IF LEN(CHARACTER) >> 1 THEN 
*The key pressed was a function key or function key sequence. 
CHAR1 = SEQ(CHARACTER[1,1]) 
CHAR2 = SEQ(CHARACTER[2,1]) 
CHARACTER = CHAR1:' ':CHAR2 
END ELSE 
CHARACTER = SEQ(CHARACTER) 
END 
MSG('The ASCII code for the keystroke entered is: %1%','','', CHARACTER) 
MSG('','DB',IMAGE,'')
  • tips/revmedia/subs12.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1