Skip to content

Function_Return

See Also: Function, End_Function

Purpose

To return execution from a function with a return value.

Syntax

Function_Return {returnValue}

returnValue can be a constant, variable, or expression whose value is returned.

What It Does

The Function_Return command terminates execution of a function and returns a value to the caller. If no returnValue is supplied for the command, zero is returned. Execution returns to the line following the call to the function.

There may be as many Function_Return commands as desired in the body of the function, but no more than one will execute each time the function is called. Functions with many exits often become more difficult to debug.

If returnValue is a variable, its type does not have to match the type given in the function command for the return value, but its value must be convertible to that type.

Notes

  • If no Function_Return is executed before execution reaches the End_Function command, execution will return at that point with a returnValue of zero.