|Navigation: Templates > Guide to all Templates > Control Templates >====== DOS File Lookup control template ======|
The DOSFileLookup template adds an ellipsis (…) button which opens the standard Windows file dialog.
You can specify the file masks, the default directory and filename, and the variable to receive the filename selected by the end user.
In addition, you may optionally allow the selection of multiple files and specify the code to process each selected file. The template generates a LOOP to process all the selected files.
Another new feature supported is the ability to assign the filename selected directly to an IMAGE control.
The DOSFileLookup template provides the following prompts:
|File Dialog Header||Type the text for the caption of the Windows file dialog.|
|DOS Filename Variable||Press the ellipsis (…) button to choose a variable to receive the end user's choice from the Select Column dialog. You can also type the variable name directly into the entry box.|
|Default Directory||Specify the starting directory for the Windows file dialog. If blank, the file dialog opens to the working directory. If you want to use a variable for the pathname, then you must preface it with an exclamation point (Example: !Myvariable).|
|Default Filename||Specify the initial filename for the Windows file dialog. If blank, the file dialog opens with no initial filename.|
|Return to original directory when done||Check this box to reset the working directory to its value prior to the file lookup.|
|Long Filenames?||Check this box to enable the Windows file dialog to allow the selection of files with long filenames.|
|Dialog Type||Select the type of dialog that you want to present to the user. Open allows a user to simply access a file name from the Open dialog. Save allows the user to update the contents of the filename selected. Directory allows the user to return the path only (no filename) as presented by the Windows dialog.|
|Don't Report Errors||Check this box to allow errors to be reported if a file name could not be opened or saved.|
|Return Default on Cancel||Check this box to automatically return the default directory or filename value if the user presses the Cancel button in the appropriate dialog window.|
|Multi-Select?||Check this box to allow selection of one or more files.|
|Action For Each Selection||Type a valid Clarion language statement to execute for each selected file–typically a procedure call. You may want to pass the FileName Variable as a parameter to the procedure.|
|The template generates a LOOP to execute the code you specify for each selected file. The generated code reloads the FileName Variable with the appropriate filename for each loop cycle.|
|Assign to Image Control||Check this box if you wish to assign the selected filename's contents to an image control. Use the Image Control drop list to select the image control's Field Equate Label.|
|Resize to control size||Check this box to designate that the filename's contents assigned to the target Image control will be resized to fit the control.|
|Set Default Mask Value||Press this button to set the default file masks to use when selecting a valid image file to load into the target image control.|
|Use a variable file mask||Check this box to supply the file mask with a variable. This enables the Variable Mask Value field to name the variable, and disables the Mask Description, File Mask, and More File Masks prompts.|
|Mask Variable||Names the variable that contains the file mask. See FILEDIALOG in the Language Reference for information on the contents of this variable.|
|File Mask Description||Type a file type description. The string appears in the drop-down list in the Windows file dialog. You can add additional masks by pressing the More File Masks button.|
|File Mask||Type a file mask specification, such as “*.TXT” or use multiple patterns for this mask separating each with a semicolon, such as “*.BMP;*.GIF”. You can add additional masks by pressing the More File Masks button.|
|More File Masks||Press this button to add additional file masks. These masks are available to end the user through the List files of type drop-down list in the Windows file dialog.|
Window Update Options
|Update entire window?||Check this box to refresh the contents of all window controls after the file selection and processing is complete. Clear the box to select specific fields to refresh.|
|Update Selected Fields||Press this button to select specific fields to refresh after the file selection and processing is complete. The template generates a DISPLAY statement for each field you specify. See DISPLAY in the Language Reference.|
Use the Classes tab to override the global settings for the Class. See Classes Tab.