Update: Re: Global vs. auto variables?
User (email@example.com) posted:
I apologize. I wasn't really clear.
I would never do this to myself intentionally. I was just thinking a
little about how scope is handled in WR. And if it's possible to
access a global var if you also have an auto var in scope w/ the same
--- In winrunner@y..., alan.church@b... wrote:
address in http://docs.yahoo.com/info/terms/
Re: Update: Re: Global vs. auto variables?
User Franzen, SPS PROFI, DA (C.Franzen@DeutschePost.de) posted:
even though you indeed can use one single globally declared RC and re-use it
all the time, I really recommend to create a local variable RC in each
function where you need one.
Because if you develop the habit of using one single RC variable because you
donīt need the previously assigned value, you'll be blind to the problem
when you DO need it. Side effects simply are dangerous, even if they don't
create any problems right now...because practice tells that someday, they
will as you modify and extend the module, possibly creating dependencies
between functions (which is NOT bad practice).
It is these small seemingly cosmetical "overhead" that does make the
difference between maintainable, extendable code and code that tends to
develop new bugs when you modify a little passage (or fix an oh-so-small
Recommended reading: Code complete by Steve McConnell. (Seriously!)
DP AG/Team EPOS-NT
Schwarz, Prof. Spruth & Associates
Unternehmensberatung AG & Co. KG