Okay, I know that I'm guilty of not scoping variables here when it comes to
what I consider "local" internal variables... things like a temp. date to be
used or something along those lines.  However is there something that I am
missing when it comes to UDF's and reusing variable names?

I just ran into a situation where a variable was being redefined... it took
me quite some time to track down that the issue was happening in a UDF that
I was using.

Basically I had a variable, ThisDate, that was getting set outside a UDF
call, then a call to a UDF which also defined ThisDate, ended up changing
the value of the outside variable.  It's been a while since I did anything
with functions but isn't there a way to localize the variables between the
calling object and the function operation?  I thought that was the whole
purpose of a function - to generate a specific result (or result set) and
only return that value while leaving everything else in memory untouched.

Aside from the obvious (scoping) what am I missing?

Hatton

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 6/4/2004
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to