[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|             RETURN              |
+---------------------------------+
RETURN  [<expr> | TO MASTER
        | TO <program name>]

-----------------------------------
Returns control to calling procedure.
-----------------------------------

RETURN terminates execution of a program or a user-defined function
(UDF) and returns control to: the calling program, the highest level
calling program, another program or the Command window.

Use of RETURN at the end of a program or user-defined function is
optional since an implicit RETURN is automatic, following the last
statement of a program file.

PRIVATE memory variables are released when RETURN is executed.

<expr>
        If the program is referenced as a user-defined function, RETURN can be
followed by an <expr>.  <expr> is a value that is returned to the
calling program.  If RETURN is not included, true (.T.) is automatically
returned to the calling program.  The return value <expr> is ignored if
you DO a program.

TO MASTER
        TO MASTER returns control to the highest level calling program.

TO <program name>
        If TO <program name> is specified, control is returned to the program
specified by the <program name>.

+---------------------------------+
|         Program Example         |
+---------------------------------+
In this example, function LONGDATE returns a character string (for a
date) that is suitable for printing.

SET CENTURY ON
? longdate({08/19/89})

FUNCTION longdate
PARAMETER mdate
RETURN CDOW(mdate) + ', ' + MDY(mdate)

-----------------------------------

See Also:  FUNCTION, PARAMETERS, PARAMETERS(), PRIVATE, PROCEDURE,
PUBLIC, USER-DEFINED FUNCTIONS (UDFs)

-----------------------------------

See Also: FUNCTION PARAMETERS PARAMETERS() PRIVATE PROCEDURE
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson