Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Appendix A Displaying an Application : Using the PROCESS_FCNKEY Tool

Using the PROCESS_FCNKEY Tool
If you specify any function keys, you can use the PROCESS_FCNKEY tool in combination with any of the display statements to create a loop that automatically processes the user’s PF key selections. For example, the following two rules show how the PROCESS_FCNKEY tool and the DISPLAY & TRANSFERCALL statement could be combined to provide pseudo-conversational processing of PF keys.
Examples
The PROCESS_EXPENSES rule is called first. The first two lines initialize the scroll amount field. The third line displays the EMPLOYEE_EXPENSE screen and transfercalls to the EXPENSE_LOOP rule.

 
RULE EDITOR ===> SCROLL: P
PROCESS_EXPENSES;
_
_ ---------------------------------------------------------------------------
_ ------------------------------------------------------------+--------------
_ COMP_TITLE.SCROLL_AMT = ’P’; | 1
_ INSERT COMP_TITLE(’EMPLOYEE_EXPENSE’); | 2
_ DISPLAY EMPLOYEE_EXPENSE & TRANSFERCALL EXPENSE_LOOP; | 3
_ ---------------------------------------------------------------------------
PFKEYS: 1=HELP 3=END 12=CANCEL 13=PRINT 14=EXPAND 2=DOCUMENT 22=DELETE

 
EXPENSE_LOOP Rule
The first line of the EXPENSE_LOOP rule uses the PROCESS_FCNKEY tool to handle any PF key selection the user makes. The second statement redisplays the screen and does a recursive transfercall back to this same rule to process the next user PF key use. One of the function keys must signal the EXIT_DISPLAY exception. This causes the loop to complete.

 
RULE EDITOR ===> SCROLL: P
EXPENSE_LOOP;
_
_ ---------------------------------------------------------------------------
_ ------------------------------------------------------------+--------------
_ CALL PROCESS_FCNKEY(’EMPLOYEE_EXPENSE’); | 1
_ DISPLAY EMPLOYEE_EXPENSE & TRANSFERCALL EXPENSE_LOOP; | 2
_ ---------------------------------------------------------------------------
_ ON EXIT_DISPLAY:
PFKEYS: 1=HELP 3=END 12=CANCEL 13=PRINT 14=EXPAND 2=DOCUMENT 22=DELETE

 

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved