Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter TwoLanguage Overview (continued)

2.3 Control and Flow

Every program relies on the ability to make decisions regarding user input and changing variable values to produce appropriate outputs and behaviors. Flow control describes how a program executes to carry out its goals. There are numerous programmatic structures to alter and control script execution. These include conditional statements and loops.

Legato offers all typical flow types, including if and else if statements, the switch statement, and do, for, and while loops. These flow control statements typically evaluate a case, such as comparing the equality of two numbers, to determine a logical outcome. Blocks of code can therefore be conditionally executed as determined by the dynamic value of variables. This is the most common way of controlling what code is executed and when.

Flow control is covered in detail in Chapter Four — Flow Control. For examples of controlling program flow, see the examples in section 2.1 which feature both loops and conditional statements.