Statement RETURN Foundation
Ends procedure, user-defined function or program.
RETURN [<Expression>]
A user-defined function (UDF), a procedure or a program is ended with RETURN and control passes back to the calling function or procedure. When RETURN is used in the Main function or procedure, control returns to the operating system. All LOCAL and PRIVATE variables declared in the RETURNing function or procedure are released. In the case of an UDF, the value of <Expression> is returned to the calling routine. <Expression> can be of any data type.
A procedure or UDF ends when a new FUNCTION, PROCEDURE, CLASS or METHOD declaration or the end of file are encountered. It is good programming practice to indicate the end of a procedure or UDF with the RETURN declaration. Multiple RETURN statements can be in a UDF or procedure, but a good programming practice is to place a single RETURN at the end of the UDF or procedure. BEGIN SEQUENCE..ENDSEQUENCE can be used to break out of code sections and get to the ending RETURN statement.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.