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]:

<FONT COLOR="#0000ff">s </FONT><FONT COLOR="#800000">key</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#000080">##class</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#008080">%xsd.hexBinary</FONT><FONT COLOR="#000000">).</FONT><FONT COLOR="#0000ff">XSDToLogical</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#008000">"1B5B31387E"</FONT><FONT COLOR="#000000">))=</FONT><FONT COLOR="#008000">"F7"
</FONT><FONT COLOR="#0000ff">s </FONT><FONT COLOR="#800000">key</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#000080">##class</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#008080">%xsd.hexBinary</FONT><FONT COLOR="#000000">).</FONT><FONT COLOR="#0000ff">XSDToLogical</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#008000">"1B4F50"</FONT><FONT COLOR="#000000">))=</FONT><FONT COLOR="#008000">"F1"
</FONT><FONT COLOR="#0000ff">s </FONT><FONT COLOR="#800000">key</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#000080">##class</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#008080">%xsd.hexBinary</FONT><FONT COLOR="#000000">).</FONT><FONT COLOR="#0000ff">XSDToLogical</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#008000">"1B5B317E"</FONT><FONT COLOR="#000000">))=</FONT><FONT COLOR="#008000">"Home"
</FONT><FONT COLOR="#0000ff">u</FONT><FONT COLOR="#000000">:</FONT><FONT COLOR="#0000ff">$zu</FONT><FONT COLOR="#000000">(96,14)=1 0:(:</FONT><FONT COLOR="#008000">"+S"</FONT><FONT COLOR="#000000">) </FONT><FONT COLOR="#0000ff">r </FONT><FONT COLOR="#008000">"Input: "</FONT><FONT COLOR="#000000">,*</FONT><FONT COLOR="#800000">x </FONT><FONT COLOR="#0000ff">u</FONT><FONT COLOR="#000000">:</FONT><FONT COLOR="#0000ff">$zu</FONT><FONT COLOR="#000000">(96,14)=1 0:(:</FONT><FONT COLOR="#008000">"-S"</FONT><FONT COLOR="#000000">)

</FONT><FONT COLOR="#008000">;zzdump $key     </FONT><FONT COLOR="#0000ff">w </FONT><FONT COLOR="#008000">"You press ["</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#0000ff">$g</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#800000">key</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#0000ff">$key</FONT><FONT COLOR="#000000">),</FONT><FONT COLOR="#008000">"unknown"</FONT><FONT COLOR="#000000">),</FONT><FONT COLOR="#008000">"]"</FONT><FONT COLOR="#000000">,!</FONT>

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