openfiledialog
FOLDER
,
FILE
,
TYPE
,
TYPELIST

The openfiledialog statement pauses and displays the standard “open file” dialog.


Parameters

This statement has four parameters:

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

file – must be a variable. 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 – must be a variable. When the statement is finished, this variable will contains a four character code that identifies the type of file the user selected. There are hundreds of possible type codes. Here is a list some of the more common types you may encounter:

typelist – is the only parameter that you actually supply. This is a list of the types of files that should be displayed in the dialog. If you want the dialog to display all files, the typelist should be an empty string (""). If you wanted to display only text files, the typelist should be "TEXT" . If you want to display only picture, postscript and GIF files, the typelist should be "PICTESPFGIFf". The typelist may be as long as you want, but it should always be a multiple of four characters (4, 8, 12, 16, etc.)


Description

This statement causes the standard “open file” dialog to appear. This allows the user to select a file from the disk. Note: A new, better version of this statement is available – see ChooseFileDialog. The openfiledialog statement is retained for compatibility with older databases.

Here is an example that allows the user to select a TEXT file, then appends that text file to the current database.

local file,folder,type
openfiledialog folder,file,type,"TEXT"
if file=""
    stop  /* the user pressed the CANCEL button */
endif 
openfile "+"+folderpath(folder)+file

See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0.