On Mar 07, 2007, at 22:29 UTC, Arnaud Nicolet wrote: > Well, I expected that because, for me, using self in a Win1 refers to > a Win1.
But not just any old Win1. Not the implicit global instance, either. Self means exactly *this* object, which is executing the code, nothing more or less. > For example, when one says: > > Win1.Close > Win1.Show > > Win1 is always the same window (obviously). Not at all! It is not, in fact, the same window. You're calling the Win1 function twice, and functions may return different values at different times. In this example, it will indeed return two different values, since the first line closes the window returned by the first call. > I thought that, since Self is closed, Self has no other way than be > another instance (i.e cannot remains itself since it is "no longer > valid"). It's a bit paradoxical. Yes, because you believed that Win1 would always return the same value, which is false. You also believed that Self might return two different values in the same code, which is also false. This is worth clearing up, because you're not the only one confused by it. A lot of people don't understand implicit instantiation at first. The key point is that "Win1" is a function, not a simple reference. Is it all clear now? > At least, I would not expect that nothing happen with: > > self.close > self.show > > Maybe the window open back as it was (by memorizing the window). That's what happens if you Hide a window, but if you Close it, you're telling it to shut down, close all its controls, etc. Virtually all of its data is lost at that point; all its control references are nil, and there is almost nothing it can do (though you can still access its properties as long as you have a reference). Best, - Joe -- Joe Strout -- [EMAIL PROTECTED] Verified Express, LLC "Making the Internet a Better Place" http://www.verex.com/ _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
