When writing a script sometimes it is hard to find the function you need. In Legato there are multiple ways to search for functions, including the help system and the Function Select function on the Script ribbon. This blog is going to cover the Function Select function in the Legato IDE as well as an overview of some of the other Legato editing functions available within the application.
When editing Legato files in the GoFiler application suite you may have noticed the Script ribbon. This ribbon contains all of the special functions the application offers for editing Legato scripts. Here is a subset of the Script ribbon:
The Edit toolset contains functions to aid in editing legato scripts. This includes the Function Select function which we will discuss in depth later. The Comment and Uncomment functions will either comment or uncomment the selected lines of code or single line if there is no selection. These are useful for quickly removing sections of code when debugging. The Prepare toolset has the Preprocess function and the Crunch/Integrate function. The Preprocess function runs the current script through the Legato preprocess. This will show any syntax errors in the code as well as undefined variables and other non-runtime errors. This is extremely useful but keep in mind it will not show runtime issues such as overflows or when type mismatch occurs. The Crunch/Integrate function will “compile” a script into a binary format and optionally sign the script with a digital signature. This can be useful in production environments when you do not want your production team to be able to read the source of your Legato files. Lastly, the Execute toolset contains functions to run scripts as well as debug them. These functions will be covered in a later blog.
Now that we’ve reviewed the Legato IDE functions let’s talk about the Function Select function. Please note that the F6 key is a shortcut to this function. When pressed the following dialog appears:
The first column contains the categories of functions in Legato. Clicking on a category populates the middle column with a list of subcategories. Clicking on a subcategory fills the last column with all the functions in that subcategory. Alternatively, typing in the search bar will convert the three columns into a single list that displays functions that match your search. Selecting a function from either list will populate the lower area with the function definition and basic functionality.
Pressing Select or double clicking on a function will insert the function name into your code. If the Add Parameters option is checked the parameter definition for the function will also be inserted. If the Display Help option is checked the dialog will instead launch the Legato help system and navigate to the help for the selected function. The dialog does not close when this option is used, selecting another function will navigate the help to the new function or open the help again if it was closed.
Using the search can really speed up finding functions. However, if you don’t know what category to look in and the search isn’t helping you may have better luck using the search in the Legato help system. This is because the Function Select dialog only searches the short descriptions for functions instead of the complete help. You can access the help system through the Function Select dialog or by placing the cursor on the name of a function in your legato script and pressing F1. Using the F1 key will launch the help and navigate to the help for the function under the cursor.
If the help system does not load copy the CHM file from the help folder in the application installation location to a local drive. Windows does not allow CHM files to be run from a network location for security reasons. Armed with this function and the help system finding functions in Legato could not be any easier.
David Theis has been developing software for Windows operating systems for over fifteen years. He has a Bachelor of Sciences in Computer Science from the Rochester Institute of Technology and co-founded Novaworks in 2006. He is the Vice President of Development and is one of the primary developers of GoFiler, a financial reporting software package designed to create and file EDGAR XML, HTML, and XBRL documents to the U.S. Securities and Exchange Commission. |
Additional Resources
Novaworks’ Legato Resources
Legato Script Developers LinkedIn Group
Primer: An Introduction to Legato