.. highlightlang:: us .. index:: GetOpenFileName_Data .. _getopenfilename_data: GetOpenFileName =============== .. us.tag GetOpenFileName_Data ENGLISH FILE_MISC DialogBoxes New5305 :ref:`GetOpenFileName` opens a Open File dialog box. .. function:: svFileName = GetOpenFileName_Data(ssDir, bMultiselect, bSortByDate, bConvertToNC) .. us.return **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. .. us.params **Parameters** .. uparam:: ssDir The parameter *ssDir* contains a path name. Example :file:`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. .. uparam:: 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. .. uparam:: bSortByDate If the parameter is set to TRUE (1), the selected files are sorted by the date of the last modification. .. uparam:: 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). .. us.example **Example** Use :ref:`GetProfileString` and :ref:`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]); .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - 5.30.5 - New .. seealso:: :ref:`overview-files`, :ref:`overview-dialogboxes`, :ref:`GetSaveFileName`, :ref:`GetOpenFileName`, :ref:`DialogBox`, :ref:`MessageBox` :sub:`id-1623903`