next up previous contents index
Next: fail Statement Up: Statements Previous: Loops

return Statement

 

  As discussed in Chapter 6, page gif, normally a function's execution proceeds until the last statement of the function. If that statement is an expression then the value of the expression becomes the result of the function call; otherwise the result is F. A function can also prematurely terminate using the return statement, which has two forms:

return

return expression

The first form results in a returned value of F; the second form returns the value of expression.

See Chapter 6, page gif, for examples.



Thu Nov 13 16:44:05 EST 1997