That's okay, but you're missing an EXIT code when it's finished. All UDF code should have an Exit code and not just Exit either. This has been discussed in the past and shown that on some occassions it can lead to other problems if an Exit with value is not supplied.