.. highlightlang:: us .. index:: GetOpenFileName .. _getopenfilename: GetOpenFileName =============== .. us.tag GetOpenFileName ENGLISH FILE_MISC DialogBoxes :ref:`GetOpenFileName` opens a Open File dialog box. .. function:: 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) = GetOpenFileName() = GetOpenFileName(ssDir) = GetOpenFileName(ssDir, ssFilter) = GetOpenFileName(ssDir, ssFilter, nFilterindex) = GetOpenFileName(ssDir, ssFilter, nFilterindex, bMultipleSelect) = GetOpenFileName(ssDir, ssFilter, nFilterindex, bMultipleSelect, ssTitle) .. us.return **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. .. us.params **Parameters** .. uparam:: 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. .. uparam:: 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 (*.*)|*.*|" .. uparam:: nFilterindex This parameter specifies which filter is selected when the dialog box is displayed on the monitor. The filter enumeration starts with 1. .. uparam:: 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. .. uparam:: ssTitle String with the dialog title. .. us.example **Example** :: GetOpenFileName() d:/data/test.dat ssFileName = GetOpenFileName("c:", .. "UniScript Files (*.ic)|*.ic|" + .. "All Files (*.*)|*.*|") if (ssFileName != "") { // Load the file ssFileName. } .. seealso:: :ref:`overview-files`, :ref:`overview-dialogboxes`, :ref:`GetSaveFileName`, :ref:`GetOpenFileName_Data`, :ref:`DialogBox`, :ref:`MessageBox` :sub:`id-139001`