>I was instructed one time here on UT to avoid declaring variables as Public. I have started useing a custom class and it's properties to handle my global variables. However, I am havig a little difficulity now. I create a form class. I call it with CreateObject(). If I don't assign it a Public variable I can't control it globally. If I try and assingning it to one of my custome class variables so that it is global then try to Release myclass.myForm I get a message the "Must be a variable or array" meaasge.
3 choices (at least):
1. While a proliferation of globals can be bad practice, a single global is fairly reasonable. Some people handle an application-level object that way. Ex:
PUBLIC goApp
goApp = CREATEOBJECT("MyAppClass")
2. You can "attach" an object to _SCREEN. Ex:
ADDPROPERTY(_SCREEN, "oApp")
_SCREEN.oApp = CREATEOBJECT('MyAppClass')
? _Screen.oApp.whatever...
3. If your app has a top-level PRG, you can create the object as PRIVATE instead, and it will be seen thoughout, as all other code will be lower in the stack.
-- Randy