613-518-1166 info@zimdatabases.com

ZIM Language Reference

$filebrowse

< All Topics

$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:

  • If the application user activates the Cancel push button, $Null is returned.

  • If the application user makes a selection (multiple selections not enabled), the function returns the directory path concatenated with the file name.

  • If the application user makes a selection (multiple selections enabled), the function returns the directory path and a list of one or more file names separated by semicolons.

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”)

 

See Also

$ClipPath

$DBPath

$ImagePath

$WorkPath

$ZimPath

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Table of Contents