xHarbour Reference Documentation > Statement Reference xHarbour Developers Network  

RETURN

Branches program control to the calling routine.

Syntax

RETURN [<retVal>]

Arguments

<retVal>
<retVal> is an expression of arbitrary data type that is passed from methods or functions to the calling routine. Procedures do not have a return value.

Description

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.

Info

See also:BEGIN SEQUENCE, ErrorLevel(), FUNCTION, LOCAL, PRIVATE, PROCEDURE, PUBLIC, QUIT
Category: Control structures , Statements


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe