$filebrowse

Presents the application user with a File Open common dialog box.

Syntax

$filebrowse(directorypath,pattern,flags[,heading])

Parameters

directorypath

A character string or an expression that evaluates to a character string, naming the default directory path to show in the dialog box. If path is the null string (''), the current directory is used as the default directory.

pattern

A character string or an expression that evaluates to a character string, specifying the pattern names and associated patterns that can be searched for, in the dialog box. If pattern is the null string (''), no patterns are searched for. Otherwise, pattern is specified in the form:
"patternname1|pattern1[«|patternname2|pattern2»]"

flags

A number or an expression that evaluates to a number, determining the attributes of the dialog box.

heading

A character string, or an expression that evaluates to a character string, setting the title for the dialog box.

 

Flags

Meaning

Constant Name

1

File must exist.

cFileMustExist

2

Path must exist.

cPathMustExist

4

Prevent read-only files from being returned.

cNoReadOnlyFiles

8

Enable multiple selections.

cAllowMultiSelect

Flags can contain any single number, or the sum of two or more numbers from the Flags column.

Return Value

For EntitySets, relationships, and application directories, the value returned is the number associated with the disk file that contains the specified object.

For application documents, the value returned is the number associated with the disk file that contains the application directory in which the application document was created.

Comments

Use $filebrowse to display the File Open common dialog box and select a file.

The value returned by the function depends on the application user's interaction with the dialog box:

Example

A properly constructed pattern appears as shown below:

'All files |*.*|ZIM files|*.zim;zim0*'

In the following code fragment, the variable vIconFileSel is assigned the results of the user's interaction with the File Open dialog box:

let vIconFileSel= $filebrowse ($concat($DBPath, "\\Icons"), \
       "Icon files|*.ico|All files|*.*", \
       cFileMustExist + cPathMustExist, \
       "Icon File Selection")

 

Related Topics