Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter SixteenApplication (continued)

GetSetting Function

Overview

The GetSetting function retrieves a single line item as a string from a Windows-style initialization (ini) file.

Syntax/Parameters

Syntax

string = GetSetting ( [string fnTarget], string section, string entry );

Parameters

fnTarget

An optional string defining the target file containing the settings. If the parameter is omitted (i.e., there are only two string parameters provided to the function), the target name will be the name of the script plus an ini script with the path being located in the application’s roaming profile area. For example, if the script name is “Production Interface.ls” the target will default to “%appdata%/application/Production Interface.ini”. Where %appdata% is the user’s roaming profile, normally located in the user data area under “AppData” and the application is the vendor application area, for example “Novaworks”. If the string is supplied but is empty, the default application workstation settings file is used for the target. If a filename is provided without a path, the file is referenced from the application data folder (%appdata%).

section

A string specifying the section (also known as the application name) in which the entries are grouped. This name is contained within brackets inside the target file. Every entry must belong to a section.

entry

A string specifying the entry name (also known as the key name) identifying the data. The entry identifies the line item within the section. For example, the line entry within a section, ‘My Key=Some Data”, the ‘My Data’ field is the entry or key name and ‘Some Data’ is the data associated with the key.

Return Value

A string specifying the data associated with the target, section and entry. If the string is empty, it may indicate an error or an empty entry. Use the GetLastError function to determine if the string was empty or if there was an error.

Remarks

If the target is located in the user’s roaming data area, it will be private to that user and possibly available on other workstations the user logged into (provided roaming profiles are enabled).

Note that many applications employ two ini files: preferences and workstation settings. The ‘application.ini’ file contains the workstation settings while ‘application settings.ini’ contains the preferences. Workstation settings contain information such as the file history list, window positions, etc. The preferences (settings) file contains operation preferences such as import settings, editing default information, etc. Script programs should avoid writing to the preferences since they are managed in a manner that will result in unknown information being purged anytime the settings are changed within the application preference dialogs.

Related Functions

Platform Support

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

Legato IDE, Legato Basic