I am old fashioned but trying to understand the aurgument about GLOBAL's, it seems its all about documentation, OK. But then I have to question the lengths some programmers go to not to use them. A common recommeded trick seems to be put the data or a pointer to the data into the USER sections of a window or control. But that is a poorly documentable GLOBAL ie accessable from anywhere in the program while the window or control exists (I wouldn't even want to think about what happens when the window or control does not exist when the data is requested).
So effectively they create a GLOBAL that can't be addressed by name only by index and can only contain a LONG so if it is not a LONG you are after it has to be a pointer.
Just how badly documentable and dangerous can you get? The data it points to has to be persistant ie STATIC not a LOCAL which is on the stack as it will most likely be out of scope and destroyed before you try to access it (GPF almost gaurenteed)!!
To me it seems the choice between sensible documented use and hard to document dangerous methods just to be proud you live by the the rule of no GLOBALS
So effectively they create a GLOBAL that can't be addressed by name only by index and can only contain a LONG so if it is not a LONG you are after it has to be a pointer.
Just how badly documentable and dangerous can you get? The data it points to has to be persistant ie STATIC not a LOCAL which is on the stack as it will most likely be out of scope and destroyed before you try to access it (GPF almost gaurenteed)!!
To me it seems the choice between sensible documented use and hard to document dangerous methods just to be proud you live by the the rule of no GLOBALS
Comment