UPON new-window
DISPLAY FLOATING WINDOW UPON MAIN-WINDOW, ...
when the DISPLAY statement terminates, the new floating window becomes the current window, instead of the main application window.
DISPLAY SUBWINDOW UPON WINDOW-1, AT 0504, LINES 5, SIZE 30, BOXED "Line 1", LINE 1, "Line 2", LINE 2.
The above code creates a new subwindow in WINDOW-1 and then displays two lines in the new subwindow. The UPON WINDOW-1 phrase applies to both the DISPLAY SUBWINDOW operation and the display of the subsequent text items because they are all specified in one DISPLAY statement.
DISPLAY FLOATING WINDOW UPON WINDOW-1 LINES 10, SIZE 40, BOXED, HANDLE IN WINDOW-99; "Line 1", LINE 1, "Line 2", UPON WINDOW-2, LINE 2 "Line 3", LINE 3.
In this example, the new floating window (WINDOW-99) is created with WINDOW-1 as its parent (because of the first UPON phrase). Normally, this UPON phrase would cause "Line 1" to display in WINDOW-1 too, but the DISPLAY FLOATING WINDOW operation causes the new window to become the current window. So, "Line 1" is shown in WINDOW-99 instead. This would apply to "Line 2" also, but it specifies its own UPON phrase, so it displays in WINDOW-2. "Line 3" also displays in WINDOW-2 because that was the last window specified. At the end of the DISPLAY statement, the new floating window, WINDOW-99, is made the current window.