Previous Topic: A Cursor Sensitive Help ProgramNext Topic: Program That Finds the Screen ID


Program That Waits for the User to Select Help

In the following program, PF1 is the HELP key. You can use any action key as the help key, but it should be a key that is not used by the application. The following code passes all input from the terminal directly to the application until the user presses PF1. When the user presses PF1, the ACL/E help program (HELPACL) is invoked.

LOOP     INPUT                    WAIT FOR AN ACTION KEY 
         COMPARE '&TAID','PF1'    DID THE USER PRESS PF1?
         BRANCH NE,SKIP           IF NOT, SEND IT TO THE APPL 
         ACLPGM HELPACL           IF PF1, INVOKE HELP PROGRAM 
SKIP     SEND                     SEND ACTION KEY TO APPLICATION 
         BRANCH ANY,LOOP          GO BACK AND WAIT FOR ANOTHER