You can put the writelog udf anywhere in your script. At the end keeps things readable imho. You can also use the Call command to call another script that in this case can hold all UDF's you need.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.