GDDM V3R2 Base Application Programming Guide
|
Previous topic |
Next topic |
Contents |
Index |
Contact z/OS |
Library |
PDF |
BOOK
Example of selection with cursor, light pen, and PF key GDDM V3R2 Base Application Programming Guide SC33-0867-01 |
|
The program in Figure 91 creates a display from which the terminal operator must select one of four options. The format of the map it uses is shown in Figure 92. All the text is constant data. There are three methods of selection:
The main loop of the program is executed once each time the operator makes a selection. The first statement of the loop, C , clears the ADS. This removes any message outstanding from a previous iteration, and sets the selector and cursor adjuncts to blank. This means that GDDM uses the map-defined cursor position and the default data for all the option fields. If the last input was incorrect, the error message is then copied into the ADS. The MSPUT, D , updates the page with all the changes resulting from C , and with the error message, if this is required. It specifies a write-type operation, so the blank designator characters specified in the map are put into the selectable fields before every execution of the ASREAD. This prevents any problems arising from the operator overtyping these characters. The SELECT statement, E , discovers which selection method the end user used, by testing the first ASREAD parameter, ATTYPE. If the value 0 is found at F , meaning that the ENTER key was pressed, the group of statements starting at G is executed. These find which of the cursor adjuncts contains a character 1. The program calls a subroutine to perform the requested function, or sets a flag if terminate was requested. If no option was selected, the error flag is set. If the value 1 for ATTYPE is detected at H , the second ASREAD parameter, called ATVAL, is tested by the group of statements at I , to discover which PF key was pressed. If the value 2 for ATTYPE is found at I , meaning that the light pen (or CURSR SEL key) was used, the selected field is discovered in the statements at J . If ATTYPE has some value other than 0, 1, or 2, the end user must have pressed an invalid key, so the error flag is set at K .
|
Copyright IBM Corporation 1990, 2012 |