Doriano Blengino a écrit : ... >> i.e.: >> TreeView1_MouseDown() >> TextBox2756.Text = "xxxxxxx" >> LAST.Enable = TRUE => does it apply to TreeView1 or TextBox2756 ? >> END >> > applies to TreeView1 -------------^ > > I see your ideas are not clear. In the above subroutine LAST refers to > the object which raised the event - presumably TreeView1 when you > pressed a mouse button on it. But you can make several objects call the > same event handler: > > ANewButton = new Button(me) as "TreeView1" ' just to explain... > > After that declaration, if you click that button, TreeView1_MouseDown > will be called, and the same will happen if you click on TreeView1 (two > different objects call the same event handler). But in the first case > LAST will refer to ANewButton, in the second it will refer to TreeView1. > That's all - no other meanings can be attached to LAST, and its life > ceases when the subroutine (i.e., event handler) ceases. LAST is a > global variable, so gambas will let you access it even when such a thing > would be wrong; it makes sense only when referring to "the object which > raised this singular event I am managing now".
Thanks Doriano it is now clear; so I'll stick to real name to avoid any side effect. JY -- It is far better to sleep with an old hen than pullet. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user