Mark, I just used "dim" out of habit trying to keep local vars local. I did check and verified that you are correct parameters are local to the function and do not need to be "dim"'ed. Thanks for educating me.

Your comments on the file handles are a different matter as I interpret your statment. File handles do appear to be global. the following test code illustrates the point.
code:
function writelog ($x)
$rc = open (1, "Junk2.txt", 5)
? "function open: $rc"
$rc = writeline (1, $x)
$rc = close(1)
? "function close: $rc"
endfunction

IF Open(1, "junk.txt", 5) = 0
? "File handle 1 opened to junk.txt"
endif
writelog ("stuff for junk2")
$rc=writeline (1, "more stuff")
$rc = close(1)
? "Script close: $rc"
exit

I like Richard's object oriented ideas as well.
Everyone so far has made valuable contributions to this discussion. It may be that the best thing I learn here is to provide code in format and function that can be useful and similiar to the exisiting base of UDF's out there.

I think that for simple UDF's I will return a single value and set @error while attempting to prevent any fatal script errors with minimal code.

I would still like to here more opinions from those that want to post them.
_________________________
Home page: http://www.kixhelp.com/hb/