isCOBOL Evolve : Appendices : Library Routines : C$OPENSAVEBOX : OPENSAVE-SAVE-BOX-CHECKED
OPENSAVE-SAVE-BOX-CHECKED
The OPENSAVE-SAVE-BOX-CHECKED function opens a "Save as" dialog box. If the user chooses the name of a file that already exists, the dialog box shows a message box asking what to do. The routine returns successfully only if the user provided the name of a file that doesn’t exist or chose to overwrite an existing file.
Syntax:
 CALL "C$OPENSAVEBOX" USING OPENSAVE-SAVE-BOX-CHECKED 
                            OPENSAVE-DATA
                     GIVING returnCode
Parameters:
OPENSAVE-SAVE-BOX-CHECKED
Constant
 
OPENSAVE-DATA
Group Item
It is a structure that contains information used to initialize the dialog box. When the OPENSAVE-SAVE-BOX-CHECKED function returns successfully, this structure contains information about the user's file 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(4comp-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(4comp-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-SAVE-BOX function returns successfully, it receives the drive designator, path, file name, and extension of the selected file.
 
opnsav-flags
Not used
 
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.
 
Return code:
returnCode can be any signed numeric data item and provides additional information:
1
Operation successful. File has been chosen.
-1
The user has pressed the "Cancel" button. opensaveData contents are not updated.