CALL "C$OPENSAVEBOX" USING OPENSAVE-OPEN-BOX OPENSAVE-DATA GIVING returnCode |
OPENSAVE-OPEN-BOX | Constant | |
OPENSAVE-DATA | Group Item | It is a structure that contains information used to initialize the dialog box. When the OPENSAVE-OPEN-BOX function returns successfully, this structure contains information about the user's selection. This group item, defined in isopensave.def, has the following structure: 01 opensave-data. 03 opnsav-filename pic x(256). 03 opnsav-flags pic 9(4) comp-x value 0. 03 opnsav-default-ext pic x(12). 03 opnsav-title pic x(80). 03 opnsav-filters pic x(512). 03 opnsav-default-filter pic 9(4) comp-x value 0. 03 opnsav-default-dir pic x(128). 03 opnsav-basename pic x(128). opnsav-filename Specifies the default filename. When the OPENSAVE-OPEN-BOX function returns successfully, it receives the drive designator, path, file name, and extension of the selected file. opnsav-flags The following constants, defined in isopensave.def, can be combined to set this field: -opensave-show-preview-flag: the file chooser dialog shows image files preview on the right. -opensave-pathmustexist: the user can type only valid paths and file names. -opensave-filemustexist: the user can type only names of existing files. -opensave-createprompt: if the user specifies a file that does not exist, this flag causes the dialog box to prompt the user for permission to create the file. -opensave-noreadonlyreturn: the returned file must not be write-protected. opnsav-default-ext This item holds the default file name extension. The extension is the string of characters that appear after the "." in the file name. The value of OPNSAV-DEFAULT-EXT is added to the file name typed by the user, if the user does not type an extension. The default extension should not include the period ".". Set this item to spaces to avoid having a default extension. opnsav-title String to be placed in the title bar of the dialog box. If this member is spaces, the system uses the default title. opnsav-filters The value of OPNSAV-FILTERS describes the set of filters that the dialog box will use to restrict the set of files shown to the user. |
Filters make it easier for a user to navigate through a large directory by limiting the files shown at once. Each filter consists of a pair of descriptors. These descriptors are separated by a vertical bar character ("|"). Here is a sample OPNSAV-FILTERS setting that contains two filters: "isCOBOL source files (*.cbl)|*.cbl|All files (*.*)|*.*" opnsav-default-filter This item is used in conjunction with OPNSAV-FILTERS. The value of OPNSAV-DEFAULT-FILTER determines which of the given filters to use as the initial filter. A value of "1" selects the first filter pair, "2" selects the second pair, and so on. A value of zero also selects the first pair. This setting is not used if no filters are defined. opnsav-default-dir Specifies the initial directory. opnsav-basename When the routine returns, this item contains the base file name of the file chosen by the user. This differs from the value of OPNSAV-FILENAME in that all directory information is removed, leaving only the file name. |
1 | Operation successful. File has been chosen. |
-1 | The user has pressed the "Cancel" button. opensaveData contents are not updated. |