Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter FourFlow Control (continued)

4.11 The ‘return’ Statement

Overview

The return statement causes the execution thread to be passed to the calling function. If there is no calling function, the script exits and returns to its caller which could be the application or another script.

Syntax/Parameters

Syntax

return [parameter];

Parameters

parameter

An optional expression that creates a return value to be returned to the calling routine. If omitted, the function must have been declared as a void type.

Remarks

The data type must match the caller’s expectation. If there is a mismatch, this will result in a fatal error and the script terminating.

Use caution returning handles if declared as local variables, they will be released and the returned handle value will be invalid.

When a function is declared as a void data type, the parameter must be omitted. The last closing brace ending a function does not require a ‘return’ statement.