|
Posted by Oli Filth on 11/18/05 19:29
Maarten said the following on 18/11/2005 17:28:
> Yes, that's it! So, a variable declared inside a function isn't available
> inside nested function even while you are calling it in (global). You'll
> have to declare it global in the main function first. This can cause
> problems though, as there might be a variable with the same name outside the
> main function that you do not want to access. See what I mean? The solution
> is obvious of course, but sometimes you just don't know what variables live
> out there, do you?
>
I think the solution is: Don't use global variables!
Always explicitly pass required variables to functions.
--
Oli
Navigation:
[Reply to this message]
|