Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter NineDialog Functions (continued)

BrowseFolder Function

Overview

The BrowseFolder function displays a dialog box allowing the user to select a folder and returns the selected path to the script.

Syntax/Parameters

Syntax

string = BrowseFolder ( string title, [string path], [int mode] ) ;

Parameters

title

A string specifying the dialog box’s title.

path

An optional string specifying a starting path to set into the dialog. If the path does not exist, the segments are trimmed until a valid position is found. If a path cannot be resolved, the dialog is set to the first available path in the dialog. The parameter can be an empty string.

mode

An optional int specifying the scoping mode. By default, the mode is BROWSE_EXPLORE. This is only important if scoping is used within the application. Since the script may not know of scoping, it should indicate the type of action. To use this parameter, path must be provided.

Return Value

Returns a string containing the selected path or an empty string on failure. Use the GetLastError function to retrieve error information.

The result is UTF encoded to allow the representation of Unicode data. Use the UTFToUnicode function and related functions to convert to Unicode.

Remarks

The BrowseFolder function displays a unified dialog box that permits the user to select a folder on the file system. For example, the following code:

s1 = BrowseFolder("Test Get Folder");

results in:

Selecting a pseudo folder such as “Desktop” or “My Documents” will return the actual location within the operating system.

If the user cancels the browse function, the GetLastError function will return ERROR_CANCEL.

The mode parameter allows the scoping to be performed. If omitted, both open and save path scopes are used. The values can be as follows:

BROWSE_EXPLORE 0 — Free Standing Explorer

BROWSE_OPEN    1 — Open Browse Dialog

BROWSE_SAVE    2 — Save Browse Dialog

BROWSE_ADMIN   3 — Administrative (setup, no scope)

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic