![]() ![]() |
GoFiler Legato Script Reference
Legato v 1.6d Application v 6.1b
|
Table of Contents | < < Previous | Next >> |
Chapter Four — Flow Control (continued)
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. The return parameter cannot be dimensional.
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 a handle, if declared as local variable, as they will automatically be released making the returned handle invalid.
To return dimensional data, use the ArrayToCluster function which, in turn, will create a return string. The ClusterToArray function can then be used by the caller to create a dimensional value.
The SetLastError function can be used to return additional information in the event of an error. If a function is called prior to the return statement that sets an error condition, that condition will be returned up the stack to the caller. As such, if the last error buffer is being used, caution and reset the error if necessary by simply using the SetLastError function and setting the value to ERROR_NONE.
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.
Page revised 2025-08-15
Table of Contents | < < Previous | Next >> |
© 2012-2025 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission is prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. Novaworks, GoFiler™ and Legato™ are registered trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are the property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.