As of Build 828, you may also return from an SBX routine using a special form of the RETURN statement:
Return(<expression>)
This statement sets the return value of the function if the SBX was called via XFUNC() or XFUNC$(). If the SBX was called via XCALL or VXCALL, then the <expression> is just discarded and the statement acts like the END statement (i.e. returning to the calling BASIC program).
See External (XFUNC) Functions, below, for more details on external functions. This is an A-Shell extension and requires that you compile with the /X:2 switch.