Page History
...
Note also that the prompt key is enabled (and is handled automatically):
| Panel |
|---|
INVOICE01 Invoice INVOICE01 Invoice Inquiry Company number . . . ____ F4=Prompt |
...
- The cursor location is examined and determined to be within the boundaries of field department number. If the cursor is not within the boundaries of a field, the screen is re-displayed with an error message indicating that the cursor must be within a field's boundaries when the prompt key is used.
- The definition of field department number is located in the Repository and the associated prompting process/function extracted. If no prompting process/function exists for the field the screen is re-displayed with an error message indicating that the prompt key is not available for the field.
- The following information is posted to the exchange list:
- Field values defined in EXCHANGE OPTION(*ALWAYS) commands
- The current value of department number (i.e., the prompted field)
- If the field department number refers to another field for its definition, then its value is posted again, but under the "referred to" field's name.
- Special fields PROMPT$FN and PROMPT$RN are placed onto the exchange list. These fields contain the name of the field that is being prompted and the name of its associated reference field (if any) respectively. These fields should be defined in your repository, allowing you direct reference to them. If not, define them both as alpha (A) fields of length 10. They are supplied to the prompting process/function to allow it to determine which field is being prompted.
- If position 499 in the system definition data area DC@A01 is set to "Y" (EXCHANGE all fields on a prompt request), as many of all the other fields used by the program as will fit into the space left in the exchange list will be posted to the exchange list.
- The prompting process/functionis invoked. It is a simple program and just displays a list of all departments in a pop up window and allows the user to indicate the desired one by selecting it with the cursor. The screen panel that the user is seeing at this point might look like this:
| Panel |
|---|
INVOICE01 Invoice Inquiry INVOICE01 Invoice Inquiry |
- The user selects department number 004 (SALES & MARKETING). The prompting function has an EXCHANGE FIELDS(#DEPTNO) OPTION(*ALWAYS) command, so the selected value of department number is posted back onto the exchange list. Remember that when the prompting function was invoked it "extracted" all the things it wanted from the exchange list and then cleared it. At this point then, department number is the only thing on the exchange list.
- Control returns to the original program. Since field department number is input capable, the exchange list is examined and the values of all fields known to the original program are mapped back into its storage. In this case, only the department number is mapped back.
Finally the exchange list is cleared and the screen is redisplayed. Since the value of field department number has been changed by the value returned in the exchange list, the resulting display would now look like this:
| Panel |
|---|
INVOICE01 Invoice INVOICE01 Invoice Inquiry Company number . . . _____ F4=Prompt |
...