Ah, the light just came on! I think he wants the UDF to simply return the status in the errorcode. That way the action could be done in the body of the script instead of in the UDF.

Makes sense... UDFs should try to limit their function to one thing. Either do the function within the UDF, returning success or failure, or just return the status.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.