GetOpenFileName

GetOpenFileName opens a Open File dialog box.

svFileName = GetOpenFileName_Data(ssDir, bMultiselect, bSortByDate, bConvertToNC)

Return Value

The function returns a string vector with the complete file names. If the user chooses the Cancel button the function returns an empty string (“”). If the function is called with the parameter bMultipleSelect with the value TRUE (1), the user can select multiple files. If the parameter bConvertToNC is set to TRUE (1), the function returns the names of the converted NC files.

Parameters

ssDir

The parameter ssDir contains a path name. Example c:\UniPlot\data. If ssDir is a complete file name the file name is used to initialize the File Name edit control if the file exists.

bMultiselect

If bMultipleSelect is TRUE (1), the user can select multiple files. If the parameter is FALSE (0), only one file name can be selected.

bSortByDate

If the parameter is set to TRUE (1), the selected files are sorted by the date of the last modification.

bConvertToNC

If the parameter is set to TRUE (1), the files are converted to NC files and the names of the NC files is returned.

Comment

If an Excel file with multiple sheets is selected, a sheet selection dialog box is displayed if the parameter bConvertToNC is set to TRUE (1).

Example

Use GetProfileString and WriteProfileString to save the last directory name.

ssDir = GetProfileString("Settings", "MY_LastDataDir", "", "");
svFileName = GetOpenFileName_Data(ssDir, TRUE, TRUE, FALSE);
if (svFileName[1] == "") {
    return "";
}
svPath = SplitPath(svFileName[1]);
WriteProfileString("Settings", "MY_LastDataDir", sum(svPath[1,2]));

ssNCFile = auto_ImportData(svFileName[1]);

History

Version Description
5.30.5 New

id-1623903