No.. No.. No..

The User-Defined function (UDF) should **ALWAYS** sit outside your main script..

The way you set it up is poor practice in the sense, what if you want to use it again?

Plus, the other thing is that if you grab a copy of UDF, the author provides examples of how to use the UDF in the "real world."

I have some time to look at this script this afternoon. Just remember, how do you eat an elephant? One bite at a time! So, let's break this down to bite sized pieces to accomplish your goal.

Thanks,

Kent


Edited by Kdyer (2008-06-30 10:48 PM)
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's