Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what is the different between placi 1

Status
Not open for further replies.

kenchan98

Programmer
Feb 20, 2001
1
GB
what is the different between placing global variables at the top of the script and within the handlers?

 
not much. if you place it at the top it will be available to ALL scripts in that script member. good place if you have lots of functions defined where one global is called by lots of them.

where a global is only used by that one function i put it in the handler, when used by lots i put it at the top.

there may be some performance issues but I cant say for sure.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top