Namespacing has made managing my framework sooo much easier.
I now have always use a tree structure for the bulk of my framework
structure
i.e. create a module named "Framework"
- add a sub module "Languages"
- add a sub module "Globals"
- add a sub module "Session"
add relevant constants, functions and properties to each module
now work the namespace magic...
me.text = Framework.Languages.kMyConstant
me.text = Framework.Languages.Localise("MyString")
checkBox.value = Framework.Globals.pMyGlobal
checkBox.value = Framework.Session.ReadSetting("settingName")
etc.etc...
Namespacing rocks...
- Tom
On 27/11/2008, at 5:56 PM, Tim Jones wrote:
On Nov 27, 2008, at 8:58 AM, Bart Silverstrim wrote:
I tried putting in a global constant in my primary window with Add
Constant and set the global scope, but when I tried setting it in
another window's static text with
thatstaticbox.setString = constAppName + "More Text"
compiles fail at constAppName, so I'm suspecting that the global
constant is only accessible in the window it's declared in, despite
being global?
You'll need to refer to it as window.constAppName.
Or, you could create a global module (I call mine AppGlobals) and
place any application global properties, constants, classes, and
methods there.
HTH,
Tim
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|