xHarbour Reference Documentation > Statement Reference |
Branches program control to the calling routine.
RETURN [<retVal>]
The RETURN statement branches program control to the calling routine, eventually passing a value back. Before the called routine returns, all LOCAL and PRIVATE variables declared in this routine are discarded.
When the RETURN statement is executed by the main, or root, routine of an application, control goes back to the operating system.
Note: The RETURN statement is not the end of a FUNCTION or PROCEDURE declaration, it terminates execution of a called routine. It is possible to have multiple RETURN statements in the body of a FUNCTION or PROCEDURE declaration.
See also: | BEGIN SEQUENCE, ErrorLevel(), FUNCTION, LOCAL, PRIVATE, PROCEDURE, PUBLIC, QUIT |
Category: | Control structures , Statements |
http://www.xHarbour.com