skip to main content

Library Routines : C$OPENSAVEBOX

C$OPENSAVEBOX
The C$OPENSAVEBOX library routine provides a number of functions to allow the user to choose a file to be opened, a file to be saved, or a directory name. In thin client environment, this routine allows the user to choose a directory or file on the client machine.
Note - Due to Java implementation, Windows libraries like Documents, Music, Pictures, and Videos are not shown in the C$OPENSAVEBOX dialogs.
Syntax:
 CALL "C$OPENSAVEBOX" USING opCode 
Parameters:
Return code:
returnCode definition and meaning depend on the opcode.
Examples
Example - The following program opens a dialog box allowing the user to select multiple files and then shows the list of selected files through a sequence of message boxes.
       PROGRAM-ID. multisel.
       WORKING-STORAGE SECTION.  
       copy "isopensave.def".     
       PROCEDURE DIVISION.
           initialize opensave-data.
           call "C$OPENSAVEBOX" using opensave-open-box-multi
           if return-code = 1
              perform show-selected-file
              perform until exit
                 initialize opensave-data
                 call "C$OPENSAVEBOX" using opensave-next
                    perform show-selected-file
           display message opnsav-filename 
                   title   "The user has selected".
Example - Create an Open File box where only txt files can be selected
       WORKING-STORAGE SECTION.  
       copy "isopensave.def".     
       PROCEDURE DIVISION.
           initialize opensave-data.
           move "Text files (*.txt)|*.txt” to opnsav-filters.
           call "C$OPENSAVEBOX" using opensave-open-box
Example - Let the user find a directory where to save a file and type the filename to be saved or select an existing one. If user selects existing one the routine will ask if user wants to overwrite it.
initialize opensave-data
move "Save to file" to opnsav-title
call "c$opensavebox" using opensave-save-box-checked, 
if opensave-status > 0
   display message "Saving to file : " opnsav-filename 
   display message "Operation cancelled"

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left