Richard, with your latest post this thread is headed right where I hoped it would. My goal was to spur discussion and possibly develop some level of consensus about UDF design.

My issue started with the TranslateName UDF. I have four COM calls and wanted to know the original error text which indicated which call failed. This detail was lost if I only set @error with Exit(@error). You are correct the main reason for pursuing this direction is the enhanced ability to return sufficient information for properly reporting the failure and start debugging or even just understanding the issue is the code itself is sound.

The TranslateName UDF was failing on specific computers from time to time. It was a real pain. The additional data returned help isolate the problem to the NameTranslate.Init call which in turn was traced to a DNS issue that kept the client from finding the GC:.
_________________________
Home page: http://www.kixhelp.com/hb/