You can also achive something similar by defining a GLOBAL variable outside the UDF. Then, any modification of the variable inside the UDF will be reflected on the outside, too. However, being someone who likes clean (and elegant) code, I'd rather not define something GLOBAL for this purpose as I think that UDFs should not rely on any special outside information like GLOBAL variables.
_________________________
There are two types of vessels, submarines and targets.