Opening a file, menu or listbox

open

Open a file, menu or listbox


SYNTAX

open file_id [, file_id] …

open menu_id

open listbox_id [, listbox_id]…

Open the object or object specified.

Keyed file

open file_id [, file_id] …

Opens the specified Sculptor keyed file, but without traps or options. This is not the recommended practice. The best method of opening a file is the openfile command, which allows the programmer to trap conditions such as No such file, and to specify the file mode.

The file is opened in the mode declared in its ![o]file declaration clause. If a mode was not declared, which may be the case with the !file command, the file is opened in update mode.

No traps may be attached to the open file_id command. If the file cannot be opened, an error is displayed, and control returns to the menu. Use the openfile command to open a file with traps.

EXAMPLE:

open Samples, Control, Codes

Menu

open menu_id

Opening a menu causes all the menu items in it to be made visible, and all enabled items are available for selection. The menu remains available until closed, either by the close command, or by the opening of another menu in the same window.

If the menu is already open the command is ignored.

Popup menus: If the menu has the style flag WS_POPUP, the open command opens it in popup mode at a specified position in the window, normally in response to a right mouse click by the user. The menu closes automatically when the user selects an item, or clicks outside the menu.

EXAMPLE:

open MainMenu

Listbox

open listbox_id [, listbox_id]…

In programs compiled with Version 4.2 or later, this command can be used to open the drop-down list of a listbox. In earlier versions, open listbox_id was equivalent to show listbox_id. Use the declaration !compat open = 3 to retain the old behaviour. It is recommended that programs using the open command to make a listbox visible are modified to use show.


NOTES

  • The show command is used to display windows and other window controls.


RELATED TOPICS

![o]file

openfile

close

closefile