EXITFUNCTION This command will immediately exit the current function, optionally returning a value.
Syntax
    EXITFUNCTION Variable
Parameters
    Variable
Value Enter the appropriate value here.
Returns
This command does not return a value.
Description
The remaining code between the EXITFUNCTION and the ENDFUNCTION commands will be ignored. It is vital that if exit function command is used within a function declaration, that the return types are identical not only in data type, but whether they are arrays, variables or literals. You also cannot have expressions as part of the return data.
Example Code
    myfunc()

    WAIT KEY

    END

    FUNCTION myfunc()

    IF SPACEKEY()=1 THEN EXITFUNCTION

    PRINT "inside function"

    ENDFUNCTION
See also
CORE Commands Menu Index