realbasic-nug
[Top] [All Lists]

Statics are just one value with limited access, was Re: Confused about n

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Statics are just one value with limited access, was Re: Confused about new things in RB
From: Andy Dent <dent at oofile dot com dot au>
Date: Wed, 28 Feb 2007 12:24:48 +0900
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <NAEEKPONICFANBGONHNIGEDKDOAA dot tim at telios dot com>
On 28/02/2007, at 7:46 AM, Tim Hare wrote:

> A word of caution regarding static variables.  When used in a  
> method in a
> class definition, static variables are global to all instances of that
> class.  When used in a method of, say, a window, then they are  
> local to the
> window and act like statics from other languages, retaining their  
> value from
> one call to the next.

Please provide a clearer example of how they differ.

Static means one copy of the state and accessible only from where it  
is declared.

It has nothing to do with objects or windows.

As far as I can see, there are no subtle distinctions and I've just  
tested it to prove that a static in a Window event certainly behaves  
as expected.
_______________________________________________
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>