exitfunction variable
This command will immediately exit the current function, optionally returning a value. The remaining code between the exitfunction and the endfunction commands will be ignored. It is vital that if the exitfunction 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.
do myFunction ( 1 ) loop
function myFunction ( a ) if a = 1 exitfunction endif
print ( "end of function" ) endfunction