FKey AID Bytes

From MidrangeWiki
Revision as of 14:34, 10 June 2005 by TomHolden (talk | contribs)
Jump to: navigation, search

Function Key Attention Identifier Bytes

Introduction To Function Key AID Bytes

Function Key AID bytes can be used to determine which key was pressed in an interactive program. Using the Workstation Data Structure the function key pressed can be retrieved from 369 position. The AID byte will help you determine which actual key was pressed. Using the AID bytes also allows you to perform any things without using indicators.

Examples of AID Byte Usage

For example, using a display file with the F3 key defined as an exit key, we can define the CF function like this:

     A                                      CF03     

Inside the RPG program we can use the AID bytes to determine if the key pressed was in fact F3.

     Dwsds             ds   
     D fkey                  369    369a
         DoU FKey=x'33';
            // do more stuff
           If FKey=x'33';

Even better would be to define F3 as a named constant:

     Dwsds             ds   
     D fkey                  369    369a
     D F3              c                    Const(x'33') 
         DoU FKey=F3;
            // do more stuff
           If FKey=F3;

Sample Named Constants

Here is a list of Function Key AID Bytes:

     D F1              C                   CONST(X'31')
     D F2              C                   CONST(X'32')
     D F3              C                   CONST(X'33')
     D F4              C                   CONST(X'34')
     D F5              C                   CONST(X'35')
     D F6              C                   CONST(X'36')
     D F7              C                   CONST(X'37')
     D F8              C                   CONST(X'38')
     D F9              C                   CONST(X'39')
     D F10             C                   CONST(X'3A')
     D F11             C                   CONST(X'3B')
     D F12             C                   CONST(X'3C')
     D F13             C                   CONST(X'B1')
     D F14             C                   CONST(X'B2')
     D F15             C                   CONST(X'B3')
     D F16             C                   CONST(X'B4')
     D F17             C                   CONST(X'B5')
     D F18             C                   CONST(X'B6')
     D F19             C                   CONST(X'B7')
     D F20             C                   CONST(X'B8')
     D F21             C                   CONST(X'B9')
     D F22             C                   CONST(X'BA')
     D F23             C                   CONST(X'BB')
     D F24             C                   CONST(X'BC')
      * Page Down/Roll Up                              
     D RollUp          C                   CONST(X'F5')
     D PageDown        C                   CONST(X'F5')
      * Page Up/Roll Down                              
     D RollDown        C                   CONST(X'F4')
     D PageUp          C                   CONST(X'F4')
      * Enter                                          
     D Enter           C                   CONST(X'F1')