View Full Version : Does global procedures contain local variables?
05-27-2003, 11:20 AM
Are variables defined within a global procedure also global? Or are they local to the scope of that procedure?
05-27-2003, 11:46 AM
I am no variable guru, but after my understanding variables in a global proc are local, unless you define them as global variable so that you can use the output in other (global) procedures.
Hope this helps.
05-27-2003, 02:33 PM
Buexe is right.
If global procedures could not have local variables, every little variable you had to define in such a procedure would end up in the global variable namespace, and you'd have a huge mess!!
Not to mention that you could then never have two global procedures that differently defined a variable named $x, for example.
05-27-2003, 06:21 PM
Thanks both for your answers.
It's good to know I don't have to use the global procedure only as a mean to call other local procedures containing the variables, thus preventing the huge mess in the global variable namespace. :)
01-15-2006, 07:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2014, Jelsoft Enterprises Ltd.