Read in and process function keys

Caché

Greetings,

Can someone please show me via coding example(s) how to write an input prompt that will read in a function key, F7 for example, validate that the key pressed is F7 and then process it all via cache.

  • 0
  • 0
  • 221
  • 5
  • 1

Answers

Demo for [F1], [F7] and [Home]:

key(##class(%xsd.hexBinary).XSDToLogical("1B5B31387E"))="F7"
key(##class(%xsd.hexBinary).XSDToLogical("1B4F50"))="F1"
key(##class(%xsd.hexBinary).XSDToLogical("1B5B317E"))="Home"
u:$zu(96,14)=1 0:(:"+S""Input: ",*u:$zu(96,14)=1 0:(:"-S")

;zzdump $key
   
"You press [",$g(key($key),"unknown"),"]",!

$ZU functions are deprecated and no longer documented, and users are encouraged to replace $ZU functions with methods and properties in InterSystems class libraries that perform the equivalent actions.

In this case, $zu(96,14) is replaced by ##class(%Library.Device).GetType()

Thank you for your comment.
This code is taken from the source code %SYS, which in theory should be an example for application developers.

I hope that InterSystems developers will see your comment and make appropriate changes.

Comments