Return
Same as the Main
block, function flows from the Entry
node to the next, one node after another, until there are no more node connected. We can also interrupt the execution at any point and return to the caller by using the Return
node.
Add Return Node
Right click on the canvas of the current editing function and select Development
, then Return
:
Connect the Return node
At the point we want to return, connect the Return
node:
Return with Data
We can also return data from the function. First we will add Output
at the bottom-right of the right panel, with some Input Parameter, let's implememnt a simple add
function:
Then in Main
, we can call our Add
function with two numbers, then print the result:
Function Caller
Besides Main
block, functions can be called from other functions. Or it can be called from itself, making it a Recursive Function
.