Return Instruction

Syntax

Return
-or-
Return expr

Group

Flow Control

Description

The return instruction without an expression causes the Sub block to exit. The return instruction with an expression causes the Function/Property block to exit with the value of the expr.

VBA

This language element is not VBA compatible and requires the #Language "WWB-COM" setting.

Example


Sub Main
    Debug.Print Func(2) ' 6
End Sub
 
Function Func(N)
    Return N*3
End Function