Using Legato
The Legato Scripting Language and the IDE are included in all installations of GoFiler Complete. You may also download the Legato Interpreter for free as a standalone package below.
This package will allow you to run Legato scripts from a command line. Legato is free for development for personal or non-commercial use. By downloading Legato Basic, you agree to the Terms and Conditions of its use.
Download 32-bit Download 64-bitThis package will allow you to write, debug and run Legato scripts from an IDE. Legato is free for development for personal or non-commercial use. By downloading Legato IDE, you agree to the Terms and Conditions of its use.
Download 32-bit Download 64-bit1.0 Legato IDE and Script Language
1.1 IDE Improvements
Script Tools Improvements
– The “Function Select” dialog, F6 quick key, now replaces the current selection. This will also now replace the auto fill string from the caret position when a function is selected.
1.2 Existing API Changes and Improvements
XBRL Module
– Added support for loading extensible enumerations to the concept table within the XBRL Module. Three new key name fields have been added:
enumeration_domain — An optional field specifying the domain for an extensible enumeration.
enumeration_role — An optional field specifying the role for an extensible enumeration.
enumeration_head_usable — An optional boolean field specifying whether the heading item in an extensible enumeration is included in the enumeration.
This impacts the following functions:
XBRLAddConcept
XBRLGetConcept
XBRLGetConcepts
XBRLGetConceptByID
XBRLGetConceptCount.
– Added the source uri as a key to all locator related functions and unified the key names and documentation for the following functions:
XBRLGetCalculationLocators
XBRLGetDefinitionLocator
XBRLGetDefinitionLocators
XBRLGetFootnoteLocators
XBRLGetPresentationLocators
XBRLGetReferenceLocators
RunScript and Error Checking
– The error testing has been improved to remove ambiguity. Previously, if the called script returned an error code like ERROR_EOD, this would set an error condition as if RunScript had an error. The internal error condition is only set if an error code is return and the actual return value is zero (indicating a failure for the called script).
– Added logic to pass the SetLastError information to the calling script except for the top bit of the error code. A full 32-bits can still be returned as an int, but the last error code is limited to 31-bits.
– Assuming the last error is zero, the data type of the returned value is placed into the last error value. Thus indicating to the caller, what type of data was returned. See the documentation for RunScript for additional information.
– Added GetReturnedFloat, GetReturnedInteger, GetReturnedString and GetReturnedWString to retrieve return information (outside of a 32-bit int value). For non integer types, the return value from RunScript is ERROR_NONE.
– A change was made to the IsError and IsNotError functions to observe the ERROR_BIT (0x80000000) only. It was previously testing against ERROR_MASK (0xFF000000) for implied entry and ERROR_BIT (0x80000000) for a specified error code parameter. This is a minor change but it allows called scripts to set a last error and use 31-bits and still have robust error reporting from RunScript.
Translate
– Added XL_TARGET_UNTITLED to the incoming hook flags to indicate to the translate script that there is no place to store additional information such as images. See the TranslateAddHook function.
1.3 New API Functions
Event Log
– EventLogOpen — Opens or creates an Event Log Object.
– EventLogGetOption — Retrieve a named option from an Event Log.
– EventLogSetOption — Sets a named option from an Event Log.
– EventLogWrite — Writes a formatted string to a specified Event Log.
Help System
– GetApplicationHelpIndex — Returns the fully qualified file path for the application help index.
RunScript
– GetReturnedFloat — Gets the last returned float from a RunScript action.
– GetReturnedInteger — Gets the last returned integer from a RunScript action.
– GetReturnedString — Gets the last returned string from a RunScript action.
– GetReturnedWString — Gets the last returned wstring from a RunScript action.