Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.6f

Application v 6.4a

  

 

Chapter SixteenApplication (continued)

SetPreference Function

Overview

The SetPreference function sets a specific application preference.

Syntax/Parameters

Syntax

int = SetPreference ( string section, string name, string value, [boolean retain] );

Parameters

section

A string specifying a predefined section name.

name

A string specifying a predefined setting name.

value

A string specifying the value to set as a preference.

retain

An optional boolean values specifying whether to save the preferences on success. The default value is FALSE.

Return Value

An int as ERROR_NONE or a formatted error code on failure.

Remarks

The SetPreference function allows a single application to be set either on a temporary or permanent basis.

Placing line ending characters (“\r0x0D or “\n0x0A) in any of the string parameters will result in a run time parameter error.

SetPreference broadcasts the parameter to change to all the modules within the application. As such, the section and name values must be known within the application for the action to take effect. If the values specify and new or incorrect location, the function will not return an error. This is akin to adding an item to an INI file that is not observed by the application. Settings that are not known will not be saved if the retain flag is set.

If the multiple settings are going to be set and saved, set the retain parameter on the last call to the SetPreference function. This will reduce processing time.

Note that on startup, certain deployment schemes may override the setting(s) even if the retain parameter is set to true.

Related Functions

Platform Support

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

Legato IDE

Page revised 2026-01-05