Directives
GET_FILE_BOX Ask for Filename
   
Formats 1. Create File Box: GET_FILE_BOX path$,dir$,window$[ex_list$[,def_ex$,]][,ERR=stmtref]
2.
Check File Box: GET_FILE_BOX READ path$,dir$,window$[ex_list$[,def_ex$,]][,ERR=stmtref]
3. Write to File Box: GET_FILE_BOX WRITE path$,dir$,window$[ex_list$[,def_ex$,]][,ERR=stmtref]
4. Find Directory: GET_FILE_BOX DIRECTORY path$,dir$,window$ [,ERR=stmtref]  

Where:

dir$ Initial directory to display. String expression.
def_ext$ Default file extension. Optional. String expression.
ex_list$ List of file extensions. Optional. String expression. Comma or your choice of character as delimiter.
path$ String variable that contains the file path. Initialize this prior to executing this directive. See the note, below.
stmtref Program line number or statement label to which to transfer control.
window$ Window title. String expression.


*Note* 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.


   
Description 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 Create

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



*Note* 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, ProvideX uses the current directory. Use the form Description|*.XXX, to list standard file extensions. 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. ProvideX uses the last character in ex_list$ (the comma or your choice) as the delimiter.
   
Format 2 Check

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

Use the READ format to make sure that the file you want returned exists; e.g.,

0010 GET_FILE_BOX READ X$,"C:\VX","File to View"

   
Format 3 Write

GET_FILE_BOX WRITE path$,dir$,window$[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, ProvideX will confirm that the file is to be overwritten prior returning to the program; e.g.,

0010 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—eport files (*.RPT) and All files (*.*).

   
Format 4 Directory

GET_FILE_BOX DIRECTORY path$,dir$,window$ [,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$.