GoFiler Legato Script Reference
Legato v 1.5d Application v 5.25a
|
Table of Contents | < < Previous | Next >> |
Chapter Sixteen — Application (continued)
Overview
The PutSetting function writes or replaces a single line item as a string to a Windows style initialization (ini) file.
Syntax/Parameters
Syntax
int = PutSetting ( [string fnTarget], string section, string entry, string data | long data );
Parameters
fnTarget
An optional string defining the target file to store 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 is name 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.
data
A string or an integer (up to 64 bits) to write as the entry.
Return Value
An int containing a formatted error code. ERROR_NONE for no error or an error code.
Remarks
If the specified settings file does not exist, it is automatically created. 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).
The process must have privileges to write to the specified target location.
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 Function
Platform Support
Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL
Legato IDE, Legato Basic
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.