OPEN WINDOW

The OPEN WINDOW statement declares and opens a 4GL window.

4GLREF00000174.gif

filename is a quoted string that specifies the file containing a compiled 4GL form. This can also include a pathname and file extension.

height is an integer expression to specify the height, in lines.

left-offset is an integer expression to specify the left margin, in characters, where 0 = the left edge of the Application window.

top-line is an integer expression to specify the position of the top line of the 4GL window, where 0 = the top of the Application window.

width is an integer expression to specify the width, in characters.

window is a name that you declare here for the 4GL window to be opened.

A 4GL window is a rectangular area in the Application window that can display a form, a menu, or output from the DISPLAY, MESSAGE, or PROMPT statements. Note that the term 4GL window is distinct from a Windows graphical window like the Help window or Report window. (That is, the Application window is a graphical window that can display one or more 4GL windows.) An OPEN WINDOW statement can have the following effects:

Declares a name for the 4GL window.

Specifies the position of the 4GL window on the Application window.

Defines the dimensions of the 4GL window, in lines and characters.

Specifies the display attributes of the 4GL window.

The window identifier must follow the rules for 4GL identifiers and be unique among 4GL windows in the program. Its scope is the entire program. You can use this identifier to reference the same 4GL window in other statements (for example, CLEAR, CURRENT WINDOW, and CLOSE WINDOW).

The OPEN WINDOW ATTRIBUTE Clause

Specify a border for the 4GL window.

Display the 4GL window in reverse video or in a color.

Relocate the Prompt, Message, Menu, Form, and Comment lines.

The OPEN WINDOW ATTRIBUTE clause has the following syntax:

4GLREF00000175.gif

The BORDER Attribute

The BORDER attribute draws a border outside the specified 4GL window, in an area, occupying two lines and two character positions on the screen. Make sure to account for this space when you specify coordinates in the AT clause.

Positioning Reserved Lines

Line values specified in the OPTIONS ATTRIBUTE clause of the most recently executed OPTIONS statement can position the Form, Prompt, Menu, Message, Comment, and Error lines. If no line positions are specified in the OPTIONS ATTRIBUTE nor OPEN WINDOW ATTRIBUTE clause, then the 4GL window uses the following default positions for its reserved lines:

Default Location
Reserved for
First line
Prompt line (output from PROMPT statement); also Menu line (command value from MENU statement)
Second line
Message line (output from MESSAGE statement; also the description value output from MENU statement);
Third line
Form line (output from DISPLAY FORM statement)
Last line
Comment line in any 4GL window except SCREEN.
These positional values are relative to the first or last line of the 4GL window, rather than to the Application window. (The Error line is always the last line of the Application window.) When you open a new 4GL window, however, the OPEN WINDOW ATTRIBUTE clause can override these defaults for every reserved line (except the Error line). This disables the OPTIONS statement reserved line specifications only for the specified 4GL window.

4GLREF00000176.gif

References

CLEAR

CLOSE FORM

CLOSE WINDOW

CURRENT WINDOW

DISPLAY

MESSAGE

OPEN FORM

OPTIONS

PROMPT