Wow ... I have used newsgroups for a number of years and I have never had a
reply that was as complete and helpful as yours! I think I have may have
stumbled onto a really neat programming environment ... on first blush
REALbasic 2007 Release 3 seems to fit the bill for creating local apps for
the Mac (and PC) and, after poking around in this newsgroup it appears
users
are anxious to help newcomers ... certainly you helped me. My only
concern
now about moving from a PC to a Mac is the apparent lack of a way to use
REALbasic to create what I call "intelligent websites" ... websites that,
for example, allow me to read/write/modify files (stored on the server)
when
the user clicks certain buttons ... the equivalent to .Net's aspx files.
In
any evnt, I have much to learn about REALbasic but so far I am impressed
with it and the sup****t available through this newsgroup.
Thanks for the assistance.
"Joe Strout" <joe@[EMAIL PROTECTED]
> wrote in message
news:joe-011D81.13440207092007@[EMAIL PROTECTED]
> In article <h5Sdnfwy9r41AXzbnZ2dnUVZ_gWdnZ2d@[EMAIL PROTECTED]
>,
> "fripper" <fripper@[EMAIL PROTECTED]
> wrote:
>
>> I am an absolute newbie to REALbasic ... having used VB for the past
few
>> years. Simple question .. how do I declare a variable that is then
>> accessibl;e from all the Event handlers and Control routines? I see a
>> good
>> bit about putting global functions/subs in a modules but how do I just
>> declare a variable as global?
>
> Same way as global functions/subs, but you click the "Add Property"
> button instead of the "Add Method" one.
>
>> An example would be helpful.
>
> No problem:
>
> 1. Start a new project.
> 2. Click the Add Module button (or use the Project > Add submenu).
> 3. Double-click Module1 to open its editor.
> 4. Click the Add Property button.
> 5. Set its name to "gFoo" and its type to "String".
> 6. Click the global scope button (looks like a little globe).
>
> Now, anywhere in your code, you can refer to it by name:
>
> gFoo = "bar"
>
> But note that this is generally considered bad form, for all the reasons
> that global variables are considered evil. A somewhat better approach
> would be to set its scope to Protected (the middle, yellow caution
> icon), which still lets you access it anywhere, but only prefixed with
> the module name:
>
> Module1.gFoo = "Global variables suck!"
>
> Of course you'd want to name Module1 something more descriptive. But
> this lets you group your "global" data by topic, and avoids cluttering
> the global namespace. It also makes it obvious, any time you're looking
> at your code, exactly what "gFoo" is (i.e. a module or shared class
> property, rather than a local variable or a global defined
> who-knows-where).
>
> Best,
> - Joe
>
> --
> "Polywell" fusion -- an approach to nuclear fusion that might actually
> work.
> Learn more and discuss via:
> <http://www.strout.net/info/science/polywell/>


|