I understand if you don't set the RESULT variable it's going to be undefined anyways, but it does not state when using EXIT() the return value is the RESULT/Function result, That's my point.
Jamie
But the point you're missing is that a parameter-less "exit" will simply exit the function or procedure. This means, in the case of a function, whatever result was set to (if set at all) is what is returned since the function was exited.
The documentation clearly states that whatever the value, if any, of "result" is what the function returns if the result's value isn't set using the exit statement's parameter value.
Succinctly, the documentation does state that the function's return value can be set using the "exit" parameter or setting the result variable then exiting the function.
HTH.