A user defined function (UDF) is defined by the function...endfunction commands. The code placed in the UDF body should perform some valuable task.

A UDF is a better subroutine construct than gosub...return. It has the ability to return value like a function. Also, by using the "exit" command to leave the function, you can set the value of @error to the value passed to the exit comand as in "exit 87".
_________________________
Home page: http://www.kixhelp.com/hb/