Wiki source for CommandReturn

Show raw source

======Command return======

**return** returns from a function

return value;

**return** stops executing a function and returns from it with the value as the exit value of the function.
This becomes $? to the calling code.

function foo ()
if true ; then
return 1;
echo This should never happen;

echo $?


The return value of functions can be any expression, including XML Expressions, Java objects and sequences. The $? variable converts any non-numeric expression to a numeric value equivilent to the effective boolean of the expression. You can retrieve the native return value of functions by using them in assignment statments or passing as arguments using the [[SyntaxFunction function call]] syntax.

[[SyntaxFunction Functions]]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki