The savefiledialog statement pauses a procedure and displays the standard “save file” dialog.


This statement has three parameters:

folder – must be a variable. When the statement is finished this variable will contain the name of the folder where the selected file is located.

file – must be a variable. The procedure should place a default file name in this variable (or fill with empty text ("") if you want to force the user to type something in. When the statement is finished this variable will contain the name of the file that was selected by the user. If the variable is empty, the user pressed the Cancel button.

type – This option specifies the text that appears just to the left of the filename, at the top of the dialog. Note: Even though there appears to be plenty of room for long prompts, OS X does not display more than about a dozen characters in the prompt area. This may be fixed in future versions of OS X.


This statement causes the standard “save file” dialog to appear, in preparation for writing a file to the disk. This allows the user to select a folder and type in a file name. The statement will check to see if this file already exists, if it does, it will ask the user if he or she really wants to replace this file with a new one. Note: A new, better version of this statement is available – see SaveDialog. The savefiledialog statement is retained for compatibility with older databases.

Here is an example that exports this month’s invoice data into a text file. The user may select the name and folder for the new text file.

local  file,folder
select  Date >= month1st(today())
/* set up default filename, (Example: "Invoices Aug 92" */
file="Invoices "+ datepattern(  today( ),"Mon yy")
savefiledialog folder,file,"Export file name"
if file=""
    stop   /* pressed cancel, so stop */
export folderpath(folder)+file, exportline()+lf()

See Also


10.0No ChangeCarried over from Panorama 6.0.