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...

Comments

Russell Knight · Jul 3, 2017

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
Vitaliy Serdtsev · Jul 3, 2017

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"),"]",!
0
Aaron Wassall  Jul 23, 2019 to Vitaliy Serdtsev

$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()

0
Vitaliy Serdtsev  Jul 24, 2019 to Aaron Wassall

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.

0