KEYCHAR (return ASCII code)

Top  Previous  Next

 

KEYCHAR( )

The KEYCHAR procedure returns the ASCII value of the last key pressed at the time the event occurred.

Return Data Type:

UNSIGNED

Example:

ACCEPT                   !Wait for an event

CASE KEYCHAR()          !Process the last keystroke

OF VAL('A') TO VAL('Z') ! upper case?

 DO ProcessUpper

OF VAL('a') TO VAL('z') ! lower case?

 DO ProcessLower

END

END

 

See Also:

SETKEYCHAR

ASK

ACCEPT

SELECT

VAL

CHR