Next: , Previous: , Up: Jumps   [Contents][Index]


7.16.3 RETURN Statement

The return statement forces termination of a user-defined function or subroutine, and returns control to the statement following the call to the subroutine or function.

A subroutine need not have a return statement; The subroutine is terminated automatically when the end of the subroutine’s statements is reached. A return statement in a subroutine consists of just the word return. A function must always have a return statement, since the return value of the function is indicated by a return statement (Function Definition). Both functions and subroutines may contain more than one return statement.