[Gambas-user] Possible suggestion/question
John Spikowski
support at ...2529...
Fri Mar 2 05:37:20 CET 2012
On Fri, 2012-03-02 at 03:31 +0100, Benoît Minisini wrote:
> Anyway, there is a syntax problem. In Basic, GOSUB is ended by a RETURN
> instruction, but RETURN is already used to exit the all function. Or
> maybe RETURN will return from the function only if there is no pending
> GOSUB.
>
Most Basic languages allow exiting a GOSUB and not RETURNing. GOTO is
pretty smart in SciptBasic and used to prematurely exit any stack
tracking structure and cleans up on the way out.
In ScriptBasic the function name is used rather then RETURN.
FUNCTION myfunc ()
myfunc = 1
END FUNCTION
More information about the User
mailing list