Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter OneIntroduction (continued)

1.2 Overview of the Language

Legato is an interpreted scripting language which means it is run “line by line”. It was developed with the objective of creating a language that is in the spirit of C/C++ while still offering the benefits of an interpreted script language. Legato provides the basic, fundamental methods of flow control, including loops and conditional statements. It also offers defines for string and numeric literals and includes for external libraries and resources similar to C++. Legato has a complex parser permitting many of the common language constructs seen in modern programming languages.

Comments are allowed in C/C++ style using either double slashes ( // ) or blocks ( /* test */).

Unlike C/C++, Legato offers a string data type and built-in string math. It also provides for auto-allocatable clusters through dynamic data storage. This including arrays, objects, and strings that can grow dynamically. The memory for (and the handles attached to) these variables are handled by the script engine.

Like many other languages, Legato offers the ability to create user-defined functions. These functions can be simple or complex and can accept information in the form of passed variables. Legato is also meant to operate within a Windows environment. Many of its functions, particularly those concerning dialogs, rely on the Windows SDK. However, unlike programming within the Windows SDK, many of the underlying programming complexities are handled by the script engine. Legato also offers the ability to create multi-threaded scripts.

1.2.1 Terminology

The following terms are defined below because they have specific meanings in the context of Legato that they may not have in other programming languages.

Handles — A handle is a method of referencing an abstract item such as an object or a window. Many languages use handles in such a manner and require the programmer to pay attention to which handles are active or open and in turn make sure such handles are closed. Within Legato, there are two types of handles: managed handles to objects, and unmanaged handles to external objects.

Managed handles rarely require any special treatment as Legato will track them and release them either on the exit of a function or after the script closes. Further, each Legato handle points to a particular unique object. The internal controls of the object provide another a layer of programmatic functionality as well as safety when dealing with resources. If a handle value is used in an inappropriate manner, an error will be reported.

Unmanaged handles are not necessarily known to Legato and access to such handles is provided for the express purpose of working with the Windows SDK. For example, each window on the desktop has a unique handle, from which one could gain access to that handle and then manipulate or access properties of that window. Legato does not necessarily know the difference between a window handle or a bitmap.

Objects — Legato is not an object-oriented program, however the term “object” is used in many places to refer to an abstract item, collection of data or collection of functions. For example, a Basic File Object is an abstract thing that allows reference and manipulation through a collection of functions via a handle.