Previous Topic: Examine User InputNext Topic: Issue an Attention Interrupt


Examine the Last Action Key Pressed

The last action key the user pressed is represented by the variable &TAID. You can use &TAID in a COMPARE statement to determine what the program should do based on what the user entered. The following example shows a simple program that redirects to a statement labeled SYS1 if the user pressed PF1, or to a line labeled SYS2 if the user pressed PF2.

          DISPLAY MNU001 
          INPUT 
          COMPARE '&TAID','PF1' 
          BRANCH EQ,SYS1 
          COMPARE '&TAID','PF2' 
          BRANCH EQ,SYS2