Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter ThreeData Types and Operators (continued)

3.8 Predefined Data

3.8.1 Overview

In Legato, there are two types of predefined data: data declared using the define directive (#define) and global variables. Predefined data can be of the following types: integers, floating-point numbers, character strings, and handles. Cluster and object types, including arrays, are not permitted as predefined data.

Global variables are declared outside the scope of any particular function. They are therefore, available to the entire script. For more information on variable scope, see Section 3.2 Variable Scope. Though global variables can be used to create predefined or constant data that is available to the entire script, there is nothing to prevent a function from altering a global variable, thus changing its value for the rest of the script. Programmers are advised to use caution when using global variables to contain predefined data.

The #define directive can also be used to create predefined data. For more information on this directive, see Section 4.16 Directives.

When a defined term is used, it is effectively the same as typing that value in the script, for example:

hWords = WordParseCreate(WP_SGML_TAG);

is the equivalent of:

hWords = WordParseCreate(1);

The former is easier to read and remember. 

3.8.2 SDK Definitions

By default, Legato will run with the SDK definitions in place. These are available on the support website or can be loaded in the program files folder for the application within the “Templates\Script” folder. The definitions are in two main sections: definitions supporting Legato functions and events; and, select definitions for the Windows SDK such as dialog control styles and notifications.