realbasic-nug
[Top] [All Lists]

Constants with Global Scope

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Constants with Global Scope
From: Bart Silverstrim <bsilver@chrononomicon.com>
Date: Thu, 27 Nov 2008 10:58:51 -0500
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
User-agent: Thunderbird 2.0.0.18 (X11/20081125)
I wanted to try something I hadn't before with this and didn't see it directly in the tutorial or reference, but maybe I'm looking for the wrong thing or it already exists as part of the IDE and I overlooked it.

I wanted to set a constant string containing the name of the application so that in items like the splashscreen and title bars I could just quote it. That way if things change I can change one string and it would update everywhere.

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?

So...does this need to be a property set, or is it already in the application as a variable, or is it set as a module property to do something like this...? I know it's probably something ridiculously simple and I'm overlooking it in the language reference somewhere. Otherwise I'm going to have to remember to alter every instance in code where I code a name or version, which I suppose I could do...I wonder if anyone else does that?...

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>