Question
Russell Knight · Jul 3, 2017

Read in and process function keys

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.

Thanks...

0
0 360
Discussion (7)3
Log in or sign up to continue

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.

Thanks...

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.