Home Contact Site Map Privacy Policy Rev Search
Choose File
 

News & Info
Products
Services
Developer's Corner
Sample Projects
Site Search
Sprezzatura Links
Support Section

Up
Choose Dir
Choose File
Choose Font
System Info


 

 

 ChooseFile

METHODCHOOSEFILE
DescriptionCHOOSEFILE launches a dialog that permits the user to either open or save a file. The name of the file chosen is returned in param1.
  
OBJECTA field mark delimited dynamic array representing the options for the dialog having a layout as follows :-
 
<ZZ16CF_DIALOG_MODE$>Mode. 0 for Open, 1 for Save As
<ZZ16CF_EXT_FILTERS$>@Vm:@Svm'd list of filters

Filters dictate the type of file that will be displayed in the dialog. If this is left blank all files will be displayed. If specific subsets of files are required the filter array should be used. The filter array consists of multi-valued filter couplets, with each couplet consisting of the file type description and the file type mask separated by an @Svm. Where multiple file type masks are required for a single filter type description, these should be delimited with semi-colons.

Thus to specify text files only one would use

"Text files" : @Svm : "*.TXT"

but to also include program files one would use

"Text files" : @Svm : "*.TXT" : @Vm : "Program files" : @Svm : "*.COM;*.EXE;*.DLL"

<ZZ16CF_FILTER_INDEX$>Filter Index

The filter couplet to point to initially. In the above example, if program files were to be the default selection this value would be set to 2.

<ZZ16CF_INITIAL_FILE$>Initial File name to be displayed in the edit line for the dialog
<ZZ16CF_OPTIONS$>@Vm'd list of Boolean option flags
 
<0,ZZ16CF_OPT_MULTISELECT$>Specifies that the File Name list box allows multiple selections
<0,ZZ16CF_OPT_CREATEPROMPT$>If the user specifies a file that does not exist, this flag causes the dialog box to prompt the user for permission to create the file.
<0,ZZ16CF_OPT_FILEMUSTEXIST$>Specifies that the user can type only names of existing files in the File Name entry field.
<0,ZZ16CF_OPT_HIDEREADONLY$>Hides the Read Only check box
<0,ZZ16CF_OPT_NOCHANGEDIR$>Restores the current directory to its original value if the user changed the directory while searching for files
<0,ZZ16CF_OPT_NOUSESHORTCUT$>Directs the dialog box to return the path and file name of the selected shortcut (.LNK) file. If this value is not specified, the dialog box returns the path and file name of the file referenced by the shortcut
<0,ZZ16CF_OPT_NOLONGNAMES$>For old-style dialog boxes, this flag causes the dialog box to use short file names (8.3 format).
<0,ZZ16CF_OPT_NOREADONLY$>Specifies that the returned file does not have the Read Only check box selected and is not in a write-protected directory
<0,ZZ16CF_OPT_NOVALIDATE$>Specifies that the common dialog boxes allow invalid characters in the returned file name
<0,ZZ16CF_OPT_NOTESTCREATE$>Specifies that the file is not created before the dialog box is closed
<0,ZZ16CF_OPT_OVERWRITEPROMPT$>Causes the Save As dialog box to generate a message box if the selected file already exists
<0,ZZ16CF_OPT_PATHEXIST$>Specifies that the user can type only valid paths and file names
<0,ZZ16CF_OPT_READONLY$>Causes the Read Only check box to be selected initially when the dialog box is created
<0,ZZ16CF_OPT_SHAREAWARE$>Specifies that if a call to the OpenFile function fails because of a network sharing violation, the error is ignored and the dialog box returns the selected file name
<ZZ16CF_INITIAL_DIR$>Initial Directory
<ZZ16CF_DIALOG_TITLE$>Dialog Caption

Title to use for the dialog. If left blank the standard system defaults ("Save As" or "Open") are used.

<ZZ16CF_DEFAULT_EXT$>Default Extension
PARAM1Returns name of the folder chosen
PARAM2n/a
PARAM3n/a
PARAM4n/a
PARAM5n/a
ERRORTEXT 
  
Sample codeMethod = ""
Method<ZZ16CF_DIALOG_MODE$> = 1
File = ''
RetVal = zz_Utility_Dll("CHOOSEFILE", Method, File)
Screen shots
Sample code to display program filesMethod = ""
Method<ZZ16CF_DIALOG_MODE$> = 1
Method<ZZ16CF_EXT_FILTERS$> = "Program files" : @SVm : "*.exe;*.dll"
File = ''
RetVal = zz_Utility_Dll("CHOOSEFILE", Method, File)
Screen shots

[top]

 
Copyright © 2005 The Sprezzatura Group. All rights reserved.