[Tutor] Fw: path string
alan.gauld at yahoo.co.uk
Wed Jan 4 04:27:30 EST 2017
On 03/01/17 15:59, anatta anatta wrote:
> Please disregard my request below.
> I know the problem!
> I have not defined the variable in question as a global variable.
That's one solution but its not a very good one.
Global variables are not considered good practice for many
reasons. In particular, they make code reuse difficult and
if you ever need to use your code in a multi-threaded
environment, to improve performance say, they are nearly
impossible to work with.
It's much better to pass the required value out of the function
as a return value.
> regret the inconvenience caused.
No inconvenience, its what the list is here for! :-)
Author of the Learn to Program web site
Follow my photo-blog on Flickr at:
More information about the Tutor