MQL4 Reference Language Basics Operators Return Operator
Return OperatorThe return operator terminates the current function execution and returns control to the calling program. The expression calculation result is returned to the calling function. The expression can contain an assignment operator. Example:
In functions with the void return type, the return operator without expression must be used:
The right brace of the function means implicit execution of the return operator without expression. What can be returned: simple types, simple structures, object pointers. With the return operator you can't return any arrays, class objects, variables of compound structure type. See also Initialization of Variables, Visibility Scope and Lifetime of Variables, Creating and Deleting Objects |