Return

Used to return from a Call to the calling program or to return from a GoSub :label.

Syntax:

Return

Parameters:

(dependent) Depends on use, see below.

Returns:

(dependent) the Return command can return a value, by specifying a value (or an expression that evaluates to a value) after the "Return" keyword.

 

The Return statement returns to the statement following the most recently executed Call, GoSub or UDF. If there is no matching Call, GoSub or UDF, a Return is assumed."

The Return command can return a value, by specifying a value (or an expression that evaluates to a value) after the "Return" keyword. The value or expression may optionally be enclosed in parentheses. This feature can be used with the Call command, and with the new user-defined functions . It does not affect the Gosub command.

Examples:

 

Return 

Return (10) 

Return "Okay" 

Return myvariable * 10 

Return (ItemCount(list, @TAB)) 

 

A script run with the Call command can now return a value by using a Return command with a value (see above). If a Return command without a value is used, or the called script does not contain a Return command, the called script will return 0.

Example:

result = Call("other.wbt", "")
Example:
Display(2, "End of subroutine", "Returning to MAIN.WBT")
Return
See Also:

Call, Exit, GoSub, UDF