[Next] [Prev] [_____] [Left] [Up] [Index] [Root]
Return

Return

The word `return' may be found in functions and procedures.

When Magma is executing a function call and the function has been defined in statements form, the statement

return EXPRESSION, ..., EXPRESSION;

causes Magma to evaluate EXPRESSION(s) and use the result(s) as the return value(s) of the function. During every such function call, Magma must encounter a statement like this. In the func< ... > form of function expression, no explicit return-statement is required, because the expression given on the right of the | symbol is what is evaluated to give the return value when the function is called.

When Magma is executing a procedure call and encounters the statement

return;

it will stop executing the procedure and return to the place from which the procedure was called. If Magma does not encounter a return-statement, then it will finish executing the procedure call at the end of the body of procedure statements.

[Next] [Prev] [_____] [Left] [Up] [Index] [Root]