Command Reference : Function Reference : Function Reference: U
  
 
@uifiledlg
 
Displays a standard Windows file open or save dialog
Syntax: @uifiledlg(input, filter, type)
input: string object, replacement variable
filter: string
type: string
Return: integer
Displays a file open/save style dialog.
input should be either a replacement variable or a string object in your workfile as it is used to return results. input is used to provide an initial location and possibly a name of the file, and will contain the dialog specified value on return.
filter specifies the name extensions of variables to show, with, for example, “” used to denote all files, and “prg” used to limit the display to files ending in “.prg”
type determines whether the shown dialog has an “open” or a “save” title.
Both filter and type may be specified using in-line text.
Note that the clicking OK on the dialog does not actually open or save the selected file, it merely returns the name of the selected file. Thus, specifying the type argument is simply cosmetic.)
The displayed dialog will display both an OK and a Cancel button, and will return an integer representing the button clicked: Cancel (-1), OK (0).
Examples
string myfile = "c:\temp\"
@uifiledlg(myfile, "prg", "open")
These commands display a file open dialog style containing a list of all files with a “.prg” extension in the folder “c:\temp\”. The user can navigate through the file system and select another file, whose path and name will be returned in the string MYFILE.
Note that the slightly different set of commands
string myfile = "c:\temp"
@uifiledlg(myfile, "prg", "save")
will instead display a save dialog that opens in the “c:\” folder with the filename initialized to “temp.prg” (since MYFILE does not have the trailing “\”).
Leaving the filename argument blank on input will open the dialog in the default EViews directory:
string myfile = ""
@uifiledlg(myfile, "", "save")
opens a save dialog in the default EViews directory with no filtering and no default file.
Cross-references
See “User-Defined Dialogs” for discussion.
See also @uidialog, @uiedit, @uilist, @uiprompt, @uiradio.