Ask for Filename



Create File Box:

GET_FILE_BOX path$,dir$,title$[ex_list$[,def_ex$]][,ERR=stmtref]


Check File Box:

GET_FILE_BOX READ path$,dir$,title$[ex_list$[,def_ex$]][,ERR=stmtref]


Write to File Box:

GET_FILE_BOX WRITE path$,dir$,title$[ex_list$[,def_ex$]][,ERR=stmtref]


Find Directory:

GET_FILE_BOX DIRECTORY path$,dir$,title$[,root$][,ERR=stmtref]


Multiple Selection:

GET_FILE_BOX READ LIST path$,dir$,title$[ex_list$[,def_ex$]][,ERR=stmtref]



Initial directory to display. String expression.


Default file extension to use if no file extension is specified via the file extension drop box or the file path input field. Optional. String expression.

Example: "txt"


List of standard file extensions (e.g. .jpg, .pdf, .txt, etc.). Comma or your choice of character as the delimiter (the last extension must end with the delimiter). Optional. String expression. To define a list of file extensions along with their associated descriptions, use the format Description|*.XXX, as in the following examples:



In this list of file extensions, four descriptions are specified. Each description is associated with one file extension:

Applications (displays all .exe files)
Text (displays all .txt files)
PDFs (displays all .pdf files)
All (displays all files)

If defining only one file type, a delimiter (i.e. comma) must be added to the end. PxPlus uses this last character as the delimiter.


In this list of file extensions, two descriptions are specified. Each description is associated with multiple file extensions:

(displays all .txt and.log files)
Images (displays all .png, .bmp, .jpg and .jpeg files)

Use the semi-colon to separate multiple file extensions.


String variable that contains the file path. Initialize this prior to executing this directive. See Note.


(For Windows XP or later) Optional highest level directory in which browsing can occur. (This parameter overrides dir$.)


Program line number or statement label to which to transfer control.


Window title. String expression. If not specified, the defaults for the various formats will be used.

GET_FILE_BOX is supported when you use WindX with UNIX file systems and supported calls to [WDX]. See [WDX] Direct Action to Client Machine.


Use the GET_FILE_BOX directive to display a standardized window for the user, allowing the entry or selection of a file in the system.

Format 1


GET_FILE_BOX path$,dir$,title$[ex_list$[,def_ex$]][,ERR=stmtref]

The path$ variable will receive the full pathname of the file selected. Because its initial contents will be used as the default pathname, initialize it prior to executing this directive.

Use this format to select a file. If the initial directory string is null, PxPlus uses the current directory. If no title$ is supplied, the window title will read as: "File to be Opened".

Use the format Description|*.XXX, to list standard file extensions, along with their associated descriptions. You can include multiple extensions, comma-delimited (with the last extension terminated by a comma). If desired, choose a character other than a comma to delimit each entry. PxPlus uses the last character in ex_list$ (the comma or your choice) as the delimiter. See ex_list$ for examples.

Format 2


GET_FILE_BOX READ path$,dir$,title$[ex_list$[,def_ex$]][,ERR=stmtref]

Use the READ format to make sure that the file you want returned exists:

get_file_box read X$,"C:\VX","File to View"

If no title$ is supplied, the window title will read as: "File to be Read".

Format 3


GET_FILE_BOX WRITE path$,dir$,title$[ex_list$[,df_ex$]][,ERR=stmtref]

Use the WRITE format to save or rewrite the file. If you do this and a user selects a file that already exists, PxPlus will confirm that the file is to be overwritten prior returning to the program:

get_file_box write X$,lwd,"Report file","Report files|*.RPT,All files|*.*,","RPT"

This allows the user to have a filename with the default extension .RPT and gives the user a list of files of two types - report files (*.RPT) and All files (*.*).

If no title$ is supplied, the window title will read as: "File to be Written".

Format 4


GET_FILE_BOX DIRECTORY path$,dir$,title$[,root$][,ERR=stmtref]

Use the DIRECTORY format to return a directory name to the application. The system will only allow the user to select a directory starting with directory set in dir$.

If no title$ is supplied, the window title will read as: "Browse for Folder".

(For Windows XP or later) The optional root$ parameter sets the highest level directory in which browsing can occur (overriding what is set in dir$). When not using WindX or iNomads, then the terms "My Computer" and "My Documents" can be used, as well as the full path to an existing folder.

Format 5

Multiple Selection

GET_FILE_BOX READ LIST path$,dir$,title$[ex_list$[,df_ex$]][,ERR=stmtref]

Use the LIST format to specify multiple selections for GET_FILE_BOX READ. If a single entry is selected, then path$ will contain the full path of the file (as with a GET_FILE_BOX READ). If more than one entry is selected, then path$ will consist of the full directory where the files are located terminated by SEP, followed by a delimited list of the selected files where the delimiter is defined by the 'GS' parameter.

If no title$ is supplied, the window title will read as: "File to be Read".

Windows ignores selected directories. This format is not supported in the text version of GET_FILE_BOX.

See Also

GET_FILE_BOX File Selection Dialog