Revision [1549]

This is an old revision of CommandReturn made by DavidLee on 2010-11-18 08:08:14.

 

Command return


Name

return returns from a function

Synopsis

return value;


Description

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.

Example
function foo () 
{
	if true ; then 
   	 return 1;
	fi 
	echo This should never happen;
}

foo
echo $?


Result
1



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 function call syntax.





Functions
Commands
CategoryCommands
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki