GetOpenFileName¶
GetOpenFileName opens a Open File dialog box.
-
ssFileName = GetOpenFileName()
-
ssFileName = GetOpenFileName(ssDir)
-
ssFileName = GetOpenFileName(ssDir, ssFilter)
-
ssFileName = GetOpenFileName(ssDir, ssFilter, nFilterindex)
-
ssFileName = GetOpenFileName(ssDir, ssFilter, nFilterindex, bMultipleSelect)
-
ssFileName = GetOpenFileName(ssDir, ssFilter, nFilterindex, bMultipleSelect, ssTitle)
-
<ssFileName, nFilter> = GetOpenFileName()
-
<ssFileName, nFilter> = GetOpenFileName(ssDir)
-
<ssFileName, nFilter> = GetOpenFileName(ssDir, ssFilter)
-
<ssFileName, nFilter> = GetOpenFileName(ssDir, ssFilter, nFilterindex)
-
<ssFileName, nFilter> = GetOpenFileName(ssDir, ssFilter, nFilterindex, bMultipleSelect)
-
<ssFileName, nFilter> = GetOpenFileName(ssDir, ssFilter, nFilterindex, bMultipleSelect, ssTitle)
Return Value
The function returns a scalar string ssFileName containing the complete file name. If the user chooses the Cancel button the function returns an empty string. If the function is called with four parameters and the parameter bMultipleSelect is TRUE (1), the user can select multiple files. The selected files are returned as a string vector.
Parameters
-
ssDir
The parameter ssDir contains a path name. Example “c:/isocalc/data”. If ssDir is a complete file name the file name is used to initialize the File Name edit control if the file exists.
-
ssFilter
ssFilter The filter string ssFilter contains one or more strings for the file format combo box. The filter string has the following structure: “Filter Name (.)|*.*|” More than one filter can be specified, example: “Text File (.txt)|.txt|All Files (.)|*.*|”
-
nFilterindex
This parameter specifies which filter is selected when the dialog box is displayed on the monitor. The filter enumeration starts with 1.
-
bMultipleSelect
If bMultipleSelect is TRUE (1), the user can select multiple files. If the parameter is FALSE (0), only one file name can be selected.
-
ssTitle
String with the dialog title.
Example
GetOpenFileName()
d:/data/test.dat
ssFileName = GetOpenFileName("c:", ..
"UniScript Files (*.ic)|*.ic|" + ..
"All Files (*.*)|*.*|")
if (ssFileName != "") {
// Load the file ssFileName.
}
See also
Overview Files, Overview Dialogboxes, GetSaveFileName, GetOpenFileName, DialogBox, MessageBox
id-139001