The answer probably is staring me in the face and I don't see it, so
I'll just ask.
I try to limit the scope of variables and avoid global variables. But
sometimes I get stumped by the following situation and need some help:
A function sets the value of a variable that is limited to the scope of
the function. Later, another function needs the variable but does not
need to call the first function and trigger everything else in that
function. What's the best practice way of getting at that variable
without making it global?
I'll just ask.
I try to limit the scope of variables and avoid global variables. But
sometimes I get stumped by the following situation and need some help:
A function sets the value of a variable that is limited to the scope of
the function. Later, another function needs the variable but does not
need to call the first function and trigger everything else in that
function. What's the best practice way of getting at that variable
without making it global?
Comment