PICKFILE

Purpose:

Uses a native GUI system dialog box for selecting a file.

Syntax:

PICKFILE(

"folder", "title", "filter", mode)

"folder"

-

Optional. The directory (folder) where the file to be selected is located. Defaults to the working directory.

"title"

-

Optional. A string, the text to be placed on the title bar. Defaults to "File Name".

"filter"

-

Optional. A string. Display files that conform to the given wildcard pattern. Defaults to *, all files.

mode

-

Optional. An integer specifying the list display mode:

-1:

Show and select directories (folders) only.

0:

All files in the list are displayed in the normal active font (default).

1:

All files are displayed "grayed out" or inactive.

Returns:

A string representing the selected path and filename or directory.

Example:

Under Windows:

 

pickfile(gethome+"macros", "Pick a Macro", strescape("Macro Files(*.mac)\0*.mac\0\All Files(*.*)\0*.*\0\0"))

 

brings up a dialog box that has "Pick a Macro" on the title bar, prompts for "Macro Files" and only list files given in the given directory that end in the .mac extension.

Remarks:

Although the filter specification is flexible, the \0 character must terminate each prompt sub-string and file filter sub-string. A \0 character must also terminate the entire filter specification string.

See Also:

MESSAGE

PICKLIST