Post Reply 
Global variable
06-26-2017, 12:27 PM
Post: #5
RE: Global variable
(06-26-2017 05:27 AM)cyrille de brébisson Wrote:  Hello,

While it is true that using a global variable is an easy way to deal with data that needs to be used by multiple functions, it is much cleaner to pass said data to the functions as parameters and have them be local variables of the calling function. This usually avoids a lot of problems!

Cyrille
If we could pass parameters by either reference or value instead of just by value, we could eliminate most global variables. This would also save space when passing large arrays.

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Global variable - Powersoft - 06-25-2017, 06:56 PM
RE: Global variable - DrD - 06-25-2017, 07:46 PM
RE: Global variable - toml_12953 - 06-26-2017 12:27 PM
RE: Global variable - DrD - 06-26-2017, 11:48 AM
RE: Global variable - Han - 06-26-2017, 03:09 PM
RE: Global variable - DrD - 06-26-2017, 04:02 PM
RE: Global variable - Han - 06-26-2017, 08:29 PM
RE: Global variable - DrD - 06-26-2017, 09:04 PM
RE: Global variable - DrD - 06-27-2017, 11:32 AM



User(s) browsing this thread: 1 Guest(s)