To make any open 4GL window the current window, use the CURRENT WINDOW statement.
Window name |
The name of a window previously opened by the OPEN WINDOW statement |
All 4GL windows within the 4GL screen are stored as a stack which determines the order of windows and the rules according to which a window becomes the current window. When a new 4GL window is created, it becomes the current window and is put at the top of the stack. A 4GL window is removed from the stack only when it is closed, and the window which remains at the top of the stack becomes the current window.
The current 4GL window covers all the other windows and other information that is located under it. It is always fully visible and cannot be covered by any other element of a 4GL program. When a window is declared as the CURRENT WINDOW, it is moved to the top of the window stack, the window which has been current before is located right under it in the stack. To make a window the current window use the statement CURRENT WINDOW followed by the obligatory keyword IS and by the identifier of a window.
CURRENT WINDOW IS keywords must be followed by the identifier of a window which you want to make the current window. The window identifier can be specified as:
The input and output can be performed only for the current window. If during the input another form becomes displayed (e.g. by means of an ON KEY clause), the window that contains this form becomes the current window and the input can be performed only using this window. The statements that perform input or output and depend on the current window are: CONSTRUCT, DISPLAY ARRAY, INPUT, INPUT ARRAY, and MENU. When one of these statements resumes, the original window of the statement becomes the current window. A window remains the current 4GL window until another window is declared as the current one with the help of the CURRENT WINDOW statement or until it is closed by the CLOSE WINDOW statement.
The window name is static, if it directly follows the CURRENT WINDOW keywords. It can be preceded with optional scope indicators and has the following syntax:
This example illustrates a static CURRENT WINDOW statement where the window name is a constant:
CURRENT WINDOW IS my_window
If you specify a window that contains a screen form as the current window, the form automatically becomes the current form.
When a 4GL program is run, the 4GL screen becomes the current window. To make the 4GL screen the current window during the runtime of a program after one or more 4GL windows have been placed over it, use the keyword SCREEN instead of the name of a window:
CURRENT WINDOW IS SCREEN