GET_FILE_BOX |
Ask for Filename |
1. |
GET_FILE_BOX path$,dir$,title$[ex_list$[,def_ex$]][,ERR=stmtref] | |
2. |
GET_FILE_BOX READ path$,dir$,title$[ex_list$[,def_ex$]][,ERR=stmtref] | |
3. |
GET_FILE_BOX WRITE path$,dir$,title$[ex_list$[,def_ex$]][,ERR=stmtref] | |
4. |
GET_FILE_BOX DIRECTORY path$,dir$,title$[,root$][,ERR=stmtref] | |
5. |
GET_FILE_BOX READ LIST path$,dir$,title$[ex_list$[,def_ex$]][,ERR=stmtref] |
dir$ |
Initial directory to display. String expression. | ||||
def_ex$ |
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" | ||||
ex_list$ |
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: Example:
| ||||
path$ |
String variable that contains the file path. Initialize this prior to executing this directive. See Note. | ||||
root$ |
(For Windows XP or later) Optional highest level directory in which browsing can occur. (This parameter overrides dir$.) | ||||
stmtref |
Program line number or statement label to which to transfer control. | ||||
title$ |
Window title. String expression. If not specified, the defaults for the various formats will be used. |
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.
GET_FILE_BOX path$,dir$,title$[ex_list$[,def_ex$]][,ERR=stmtref]
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.
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".
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".
Directory
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.
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".
GET_FILE_BOX File Selection Dialog