Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter NineDialog Functions (continued)

BrowseSaveFile Function

Overview

The BrowseSaveFile function allows the selection of a single file presumably for a save or create operation.

Syntax/Parameters

Syntax

string = BrowseSaveFile ( string title, [string filter], [string name],
                     [int flags],   [string extension] );

Parameters

title

A string that becomes the dialog’s caption. Note that for browse dialogs, the dialog caption is used to store sticky path information in applications settings file. Depending on the application settings, the path may be remembered and used assuming no incoming path is provided to the function.

filter

A string that specifies an optional filter list. If a filter list is not provided, the default of “All Files (*.*)” will be added to the filter list. See Filters at the start of Section 9.2 Common Dialogs for filter string formatting information.

name

Specifies an optional string to direct the initial path and default filename. If a path is not provided, the last path selected for the specified title is used. Barring that, the application’s current working directory is used. The value supports UTF encoding for filenames with Unicode characters.

flags

Bitwise flags for overwrite and name testing: BSF_EDGAR_NAME causes the filename to be checked for EDGAR compliance, BSF_NO_OVERWRITE_CHECK causes the function to not warn of overwrite.

extension

An optional string specifying a default file extension to use if the user fails to add an extension. If provided, the value should be 1 to 3 characters without the leading period. When using a default extension, the filter *.* should be supplied. See Remarks.

Return Value

Returns a string as a path and filename or an empty string if error. Use GetLastError to determine the error. The most common error is ERROR_CANCEL for the user pressing the “Cancel” button.

The return string will always be a qualified and valid filename and path.

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 return of filename and path does not indicate that the script has permissions to access the file.

The function will use the Windows Common Open file dialog based on Windows Explorer or the applications browse class depending on the application settings.

If a default extension is supplied, it must be 1 to 3 characters without a leading period. Further, if the user adds an extension, and the extension is not known to Windows (in the shell file associations) or *.* is not present in the filer list, a double extension may be added.

Related Functions

Platform Support

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

Legato IDE, Legato Basic