Show/Hide Toolbars

XSharp

Purpose

Terminate a routine by returning control to the calling routine or operating system if executed from the Start() routine.

Syntax

RETURN [<uValue>]

Arguments

<uValue>May be specified in a function or method definition to designate its return value.  Procedure definitions do not allow <uValue> as part of the RETURN statement.  See the FUNCTION and METHOD entries in this guide for information about default return values if <uValue> is not specified.

Description

All private variables created and local variables declared in the current routine are released from memory when control returns.

Examples

These examples illustrate the general form of the RETURN statement in a procedure and in a function:

 

PROCEDURE <idProcedure>()
 <Statements>...
 RETURN
 
FUNCTION <idFunction>()
 <Statements>...
 RETURN <uValue>

 

The next example returns an array, created in a function, to a calling routine:

 

FUNCTION PassArrayBack()
 PRIVATE aArray[10][10]
 aArray[1][1] = "myString"
 RETURN aArray

See Also

BEGIN SEQUENCE, FUNCTION, LOCAL, PRIVATE, PROCEDURE, PUBLIC, QUIT