RETURN

Top  Previous  Next

Syntax

RETURN OPT value

Description

Returns from a subroutine.

Parameters

value - An optional value to return to the caller.

Return value

None

Remarks

You can return any built in variable type or UDT.  Strings and UDT's are dynamically copied and returned. This assures that any local string or UDT can safely be used in the RETURN statement.

The return value is optional only if your subroutine wasn't declared as having one.

See Also: SUB

Example usage

PRINT mysub(2,5)
DO:UNTIL INKEY$ <> ""
END
 
SUB mysub(c as INT, a as INT), INT
    i = c * a
RETURN i
ENDSUB