GoFiler Legato Script Reference
Legato v 1.5b Application v 5.24b
|
Table of Contents | < < Previous | Next >> |
Chapter Five — General Functions (continued)
Legato provides any number of input and output (I/O) methods. The choice and style of I/O can vary as much as programmers and users. However, there are several convenient ways to read and write data without having to establish a formal regiment. Logs are a convenient method of keeping and relaying data. They are also used by many high-level application functions such as validation. This section discusses how logs can be created, accessed, written, read, and displayed.
A log is basically a series of message records containing a message and associated properties. Generally, logs are displayed in the application’s Information View window:
The source of the log information can be any process, such as importing or validating. Within a script, a log is created, added to, referenced, and displayed as a “Log Object”. A Log Object does not need to be displayed in the Information View. If it is, its appearance in the Information View is determined by the program section displaying the log and the content of the data.
The Log Object has certain properties that can be controlled, such as its name or the default target file. The object also contains a series of records, each with a display string and properties such as the severity of an error or the location to which the error applies.
When working in the IDE (Integrated Development Environment), up to three logs will be created for each discrete run: Legato Errors, Legato Trace and Legato Log, which is the default log. The only log that can be directly adjusted is the Legato Log. When a script is executed from the IDE, any time messages are added to the log they will be displayed when the script ends.
Each discrete log, whether created or accessed by the script, is treated as a Log Object. Log Objects are created and referenced via a handle which is stored in a handle variable type. As mentioned above, the Legato engine also has a default log which is displayed when using the IDE.
If a script is called from another script, the error log and default log can be retrieved by using the GetLastDefaultLog and GetLastErrorLog functions immediately after the RunScript function.
Sometimes it is desirable to associate log information with a target file. This is particularly true when the log will eventually be displayed within the Information View. The first meta item is the target file which can be set by using the LogSetTarget function. This will associate the log with a specific file, and, if the file is not open, the Information View will open it on request. If the associated file/window is untitled obviously there will not be an associated file, so the LogSetWindow function allows a window handle to be associated. Window handles are transient and if the untitled window is closed, the association will no longer be valid. Locations and positions in the target file can be set with the LogSetPosition function. Finally, sometimes the file type may not be appropriate, for example a Data View or Forms View object’s underlying data is HTML. To get the log to open the Forms View, the LogSetFileType function allows an override of a file’s implied type and associated view.
The application and scripts have at their disposal a Global Log Object. The global object can be filled by menu functions and other scripts to pass a log back or allow a log to be modified.
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.