| Search Locate Previous Next | Contents |
This function is a very simple cover on the standard FileBox dialogue call. You may want to update it to suit your own needs.
To look for a specific file type in the default directory (typically My Documents):
fileWin.Fbx '*.bmp'
This will add *.* All files as the first element of the selection dropdown, but will preselect the file type you pass. If you want to add more information for the user here:
file Win.Fbx '*.zap' 'Zappo files'
Finally, you can set the directory to look in as the third argument:
Win.Fbx '*.bmp' 'Picture files' 'd:\temp'
To allow the user a choice of file types, you may nest the first two lists:
Win.Fbx ('*.htm;*.html' '*.txt')('Web pages' 'Text files') 'c:\temp'
This returns null if the user presses <Cancel> otherwise the result is always the fully qualified upper-case filename. You may want to strip the directory portion from this and store just the relative path to the file. If the user does not supply an extension, the returned name will be qualified with the extension from the chosen file list. In the last example, this will be .htm or .txt depending on the chosen selection of files.