Yes of course I could do it that way, but that defeats the purpose of the original suggestion.I don't want to introduce new semantics and methods of error reporting when there is something there which already works.
As more and more UDFs collect together as libraries you want to be able to use them in the same way as you would Kix functions, and that means using @ERROR and @SERROR for errors.
Finally (I do go on a bit) I want to be able to distribute UDF's as black box function libraries i.e. you put data in and get results out but whatever goes on inside is hidden and has no other effect on the rest of the script.
I don't want to be creating functions that leave people with fist sized holes in their monitors because their scripts are myseriously failing because I'm changing the content of their global variables in my UDF.
------------------
Richard Howarth