Opensavefiledialog
OpenFialDialog (Function) and SaveFileDialog (Function)
Format
openfiledialog ( prompt, path, filter )
savefiledialog ( prompt, path, filter )
returns file_name or “” if no file was selected.
Description
Displays a system dialog that allows a user to select an existing file (open/save) or a new file name (save). The function has three parameters: 1) a prompt message that will be displayed in the top of the dialog window, 2) the path or filename where the dialog box opens to, and 3) a string containing filters for specific file types.
If the path is the empty string ’’ then the current folder will be opened. Filters may be specified in the format “name (*.ext *.ext…)” if multiple filters are desired you must use two semicolons to separate them.
- Example
f = openfiledialog("",".","Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)")
print f
Permissions
A path returned by either of these functions was chosen by the user, and may afterwards be opened without a further question even when it lies outside the program's own folder. This is the tidy way for a program to work on a file somewhere else on the computer. See File and Folder Permissions.
See Also
Changedir, Close, Currentdir, Dir, Eof, Exists, Freefile, Kill, mkdir, Open, Openb, OpenFileDialog, OpenSerial, Read, Readbyte, Readline, Reset, SaveFileDialog, Seek, Size, Write, Writebyte, Writeline
New To Version
2.0.0.6