WINDOW Command [ HP ALLBASE/4GL Developer Reference Manual Vol. 2 ] MPE/iX 5.0 Documentation
HP ALLBASE/4GL Developer Reference Manual Vol. 2
WINDOW Command
The WINDOW command displays a window on the current screen.
Formats
WINDOW {window_name}
{data_ref }
Parameters
window_name
The name of a screen that has been defined as a window. (Type W on the
screen header screen.)
data_ref
One of the following, containing the name of a window:
* Constant.
* Variable or calculated item.
* Screen field name.
* Scratch-pad field name.
Description
The WINDOW command displays the specified window, starting at the window
starting line specified for the underlying data screen. HP ALLBASE/4GL
displays the window from the nominated line through to the last line of
the screen.
HP ALLBASE/4GL renumbers the fields defined for the window, starting with
the highest field number on the main data screen plus one. For example,
if the main data screen's highest field number is 23, the first field on
the window will be number 24.
When HP ALLBASE/4GL displays a window, the value in *SCREEN becomes the
name of the window.
If you define a set of function keys for the window, these function keys
replace the function keys for the main screen. If you don't define a set
of function keys for the window, the function keys for the main screen
remain unchanged. Similarly, if you define a screen help name for a
window, it is used in preference to the screen help defined for the main
screen.
The effect of the WINDOW command depends on when it is invoked, as
follows:
* If there is no current screen: HP ALLBASE/4GL ignores the WINDOW
command.
* From a function in a screen, or a function called from a function
key: HP ALLBASE/4GL displays the window, or clears the window of
data if one is already displayed. HP ALLBASE/4GL then executes
the remaining commands in the logic block, and then positions the
cursor at the first input field on the window.
* After the SCREEN command has been completed: HP ALLBASE/4GL
displays the window and executes the next command in the current
logic block.
A WINDOW command does not automatically display the window. In contrast,
the SCREEN command displays the named screen immediately.
Where one or more WINDOW commands immediately follow a WINDOW command, HP
ALLBASE/4GL displays each window in turn. Only the last WINDOW command
takes effect. That is, only the last window remains displayed. For
example:
WINDOW add_item_1
WINDOW add_item_2
If these commands are in a function called from a screen field, HP
ALLBASE/4GL displays the window add_item_1 first, and then immediately
displays the window add_item_2. The window add_item_2 remains on the
screen and input commences from the first input field defined for that
window.
Example 1
IF *- "A" THEN WINDOW add_data
ELSE WINDOW enq_data
This command is called from within a screen and initiates one of two
windows depending on the option the user enters.
Example 2
4 MOVE "S" V-scr_status
5 SCREEN new_stock
6 IF *S24 &<> "A" THEN ENTER 5
7 WINDOW add_activity
8 MOVE "25" V-field_no
9 MOVE "W" V-scr_status
10 ENTER 5
These commands show the use of a window outside the main processing
sequence of a screen.
The screen new_stock has a prior-entry function on the first field that
checks the content of the variable scr_status. If it is "W" then a
screen window has been displayed. In this case, the function moves the
contents of variable field_no to *FIELDNO.
Step 8 moves the number of the first field on the window into the
variable field_no. The last field number on the screen is 24.
On entry to the screen, HP ALLBASE/4GL processes field number 25, (that
is, the first field for the window), rather than field number 1. This
redirection occurs because the prior function has set the value of
*FIELDNO.
In this situation it is necessary to go back into the main data screen as
this is the only way that data can be accepted from the window.
MPE/iX 5.0 Documentation