You can look at my TranslateName to see how I decided to handle the return of both data and error info in an array. This has not been really accepted but was necessary to understand the error when the TranslateName UDF was called from within another UDF.

The OPEN example you sited used the DOS like format where 0 = success and any number above 0 is the error code.

When a UDF return data, I try to find the DOS error number that best fits the error I trapped and use "Exit 5" for access denied or Exit 87 (The parameter is incorrect.) for passing in bad parms. Normal exits would be "Exit 0".

When the "Exit" is used in the UDF the calling program can then check @ERROR to determine what happened.

[ 15. February 2003, 19:02: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/