Return statement


SYNTAX:
return_stmt = RETURN [ '(' expression ')' ] ';' .
The return statement terminates the execution of a function or procedure . A return statement within a function shall specify an expression. The value produced by evaluating this expression is the result of the function and is returned to the point of invocation. The expression shall be assignment-compatible with the declared return type of the function. A return statement within a procedure shall not specify an expression.
Rules and restrictions:
The return statement shall only occur in a procedure or function.
EXAMPLE
Assorted return statements.
 
RETURN(50) ; (* from a function *)
RETURN(work_point) ; (* from a function *)
RETURN ; (* from a procedure *)