An alternative to assigning function-key response indicators is being used more frequently in RPG applications. This method avoids indicator assignment and uses the function key attention identification byte (located in position 369 of the workstation information data structure) to identify which function key has been pressed. Table 1.8 illustrates how this byte can be interpreted.
Figure 1.9 illustrates the use of the attention identification byte (also referred to as the "scan code") in RPG.
.....FFilename++IPEASFRlen+LKlen+AIDevice+.Functions++++++++++++++++++++++++++++ FDSPFILE CF E WORKSTN INFDS(wsds) .....DName+++++++++++ETDsFrom+++To/L+++IDc.Functions++++++++++++++++++++++++++++ D WSDS DS D Fkey 369 369A D F3 C Const(X'33') .....CSRn01Factor1+++++++OpCode(ex)Factor2+++++++Result++++++++Len++DcHiLoEq.... C Dow FKey F3 C EXFMT ShowData C If FKey = F3 C Eval *INLR = *ON C leave C endIf C* ... program continues... C endDo