[AccessD] Global Vars (was Ambiguous Name)

Mark Simms marksimms at verizon.net
Sat Sep 24 10:36:55 CDT 2011


> 2. Bad actor changes global to a 'bad' value, which is accepted without
> error...
This does not happen if you use a Property with some validation in the Let
or Set.
MZTOOLZ has a global-to-property converter - probably for this very reason.

> 3. Other actor uses global -- BAM! BIF! POW! error.
>
> But who did the dirty deed? You can't easily tell. This is the crux of
> the 'globals are bad' arguement.
> Without knowing WHO made each change, you're stuck with a tedious
> debugging mess.
>
VBA "Find" is your friend here....however, that is worthless if you've got
10,000 lines of code and 40 places where the global is being referenced.

However, On the other hand, Property is no help in this one either....UNLESS
you are smart enough to code a property PARAMETER which indicates the Caller
source proc or function name. Then you can quickly trace within the Property
code definition each caller to determine where the problem originated. Once
discovered you can hopefully add additional validation code to insure that
condition never occurs again.






More information about the AccessD mailing list