Opening Windows and Forms

A program creates a window with the OPEN WINDOW instruction, and destroys a window with the CLOSE WINDOW instruction.

The OPEN WINDOW ... WITH FORM instruction can be used to automatically open a window containing a specified form:
OPEN WINDOW custwin WITH FORM "custform"

When you are using a graphical front-end, windows are created in a resizable window container.

The OPEN WINDOW typically uses the WITH FORM clause, to create the window and display the specified form into this new created window. It is also possible to display a new form to an existing window, by using the OPEN FORM + DISPLAY FORM instructions.

If the WITH FORM option is used in opening a window, the CLOSE WINDOW statement closes both the window and the form.
CLOSE WINDOW custwin
When the runtime system starts a program, it creates a default window named SCREEN. This default window can be used to display the main form of a program with the OPEN FORM + DISPLAY FORM instructions:
OPEN FORM f1 FROM "custlist"
DISPLAY FORM f1
If the default SCREEN window is not required (and you want to open a new initial window with the OPEN WINDOW instruction), close the default window with:
CLOSE WINDOW SCREEN