FutureBasic Logo

<<    Index    >> FutureBasic 5

exit fn   statement

exit fn

When used inside a local fn function, this statement causes the program to jump immediately to the end fn statement. The function then exits, passing back the value (if any) specified in the end fn statement. This is useful when, for example, you wish to break out of a loop and quit the function immediately; exit fn is a safer way to do this than using something like goto.

You should not use the exit fn statement outside of a local fn function.

See Also:
local fn; end fn; goto; exit <label>