Gambas Documentation
Documents

RETURN

RETURN [ Expression ]

Quit a procedure or a function by returning the value of Expression.

  • If you return from a procedure, then you cannot specify any expression.

  • If you return from a function, and Expression is not specified, then the value returned is the default value associated with the return datatype of the function.

Since 3.1

RETURN is also used by itself for returning from a GOSUB.

The RETURN statement does not take into account the FINALLY statement. It returns immediately without executing the FINALLY code.

In Visual Basic™ you must use the function name and assign it the returned value before returning from the function with "Exit Function".

See also