Contents | Prev | Next | Index
A return statement causes the termination of a procedure. It is denoted by a RETURN. It is followed by an expression if the procedure is a function procedure. The type of the return expression must be assignment compatible with the result type specified in the procedure heading.
Function procedures must have a return statement indicating the result value. In proper procedures, a return can be omitted, it is then implied by the end of the procedure body. Any explicit return statement therefore appears as an additonal, usually exceptional, termination point.
An exit statement is denoted by an EXIT. Its purpose is to specify the termination of the enclosing loop statement and continuation with the statement following that loop statement. Exit statements are semantically, although not syntactically, associated with the loop statement that contains them.
Contents | Prev | Next | Index
Canterbury Modula-2 for Java (Last documentation update
Feb 8, 2000)
Copyright © 1998 Mill Hill &
Canterbury Corporation, Ltd. All rights reserved
Please send any comments or corrections to
mhc@webcom.com