Figure 293 shows how to specify the WINDOW keyword to define a window.
Figure 293. Specifying the WINDOW Keyword (Example 1)
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 A R WINDOW1 WINDOW(4 20 9 30 *NORSTCSR) A FIELD1 8A B 5 10 A FIELD2 10A B 6 10 A R WINDOW2 WINDOW(*DFT 9 30 *NOMSGLIN) A
When the WINDOW1 record is displayed, the upper-left corner of the window border is on line 4 position 20 of the display. The lower-right corner of the border is located 10 lines lower than the upper border and 33 positions to the right of the left border.
The FIELD1 field starts 2 lines lower than the upper border and 11 positions (the ending attribute byte for the border character has been taken into account) to the right of the left border character (line 6, position 31 on the display).
The FIELD2 field starts 6 lines lower than the upper border and 11 positions to the right of the left border (line 10, position 31 on the display).
If the cursor is moved outside of the window, the function keys will remain active.
When the WINDOW 2 record is displayed, the upper-left corner of the window border is at the cursor position during run time. The message line does not appear inside the window, it appears at the bottom of the display.
If the cursor is moved outside of the window, the function keys are inactive. If the user presses a function key, they will receive a beep and the cursor will be place within the window.
Figure 294 shows how to use the WINDOW keyword to display multiple records in the same window.
Figure 294. Specifying the WINDOW Keyword (Example 2)
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 A R WINDOW1 WINDOW(&LINE &POS 9 30) A USERID 8A O 2 10 A LINE 2S 0P A POS 3S 0P A A R RECORD1 WINDOW(WINDOW1) A OVERLAY A FIELD1 5A B 7 2 A FIELD2 20A B 8 5 A A R RECORD2 WINDOW(WINDOW1) A FIELD3 10A B 2 2 A FIELD4 8A B 8 5 A FIELD4 8A B 8 5 A
When the WINDOW1 record is displayed, the upper-left corner of the border will be at the line and position numbers specified by the LINE and POS fields, respectively. The lower-right corner of the border is located 10 lines lower than the upper border and 33 positions to the right of the left border.
The USERID field starts 2 lines lower than the upper border and 11 positions to the right of the left border character.
If RECORD1 (from the previous example) is displayed, it is placed within WINDOW1. Its fields are positioned with respect to the upper-left corner of the window. The fields from record WINDOW1 which were on the display remain because the OVERLAY keyword was used on RECORD1 and the two records do not overlap. For more information on the OVERLAY keyword, see the OVERLAY (Overlay) Keyword for Display Files.
If RECORD2 (from the previous example) is displayed, it is also placed within WINDOW1. Its fields are positioned with respect to the upper-left corner of the window. Because the OVERLAY keyword was not used, the fields from records WINDOW1 and RECORD1 are removed from the window.
Figure 295 shows how to use the WINDOW keyword with a subfile.
Figure 295. Specifying the WINDOW Keyword (Example 3)
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 A R SFLDATA SFL A NAME 20A B 4 5 A RANK 10A B 4 27 A SERIAL 8A B 4 38 A A R WINDOW1 SFLCTL(SFLDATA) A WINDOW(8 25 10 50) A SFLPAG(4) A SFLSIZ(17) A SFLDSP A SFLDSPCTL A 2 5'Full Name' A 2 27'Rank' A 2 38'Serial Nbr' A
When the WINDOW1 subfile control record is displayed, it and the subfile are displayed in a window. The upper-left corner of the window border is at line 8, position 25 on the display. The lower-right corner of the border is located on line 19, position 78.
The fields from both the subfile record and subfile control record are located with respect to the first usable window position in the upper-left corner of the window. For example, the NAME field in the SFLDATA record starts on the 4th window line and the 5th window position, which is the same as the 12th line on the display and the 31st position on the display.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.