If you place the UDF code in your script then it can be almost anywhere in the script. if you call it from the script then it should be called before using the UDF.

I always test with a small script that will give me some error (on purpose) and when all is ok I integrate it into the production script.

 Code:
Break on

If Not Exist("c:\\somefolder")
	;Write stuff in error log
Else
	;Folder exists. Do nothing.
EndIf
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.