but can't you do the same contrived goofiness with me.spritenum? And why are you bothering to set spriteNum to me.spriteNum....that's already given to you by the act of property spriteNum.
I admit that this is 95% preference....though I don't understand why people demand to have two different properties on a behavior to get the spriteNum or always use me.spriteNum which I believe has been shown to be slower. I always default to property spriteNum on whatever thisAttrib = sprite(spriteNum).whatever end etc. You don't need to tell the behavior that spriteNum = me.spriteNum...that's given by the act of declaring property spriteNum. The only time I specifically use me.spriteNum is when a particular behavior is known to be something that will be inherited...because as an ancestor, it won't have that property spriteNum. So, I can understand 'preparing for inheritance' and defaulting to me.spriteNum, but I've used that so seldom, that I don't bother. roymeo At 02:39 PM 8/15/2002 -0700, you wrote: >I prefer to not use spriteNum as a property. Here is an example, albeit >contrived, of what is improper about it. The thing to bear in mind is that >the terms "spriteNum" and "rect" are a Lingo key word... > >Here is a demo behavior... >___________________________________ >property spriteNum >property rect > >on beginSprite(me) > spriteNum = me.spriteNum > rect = sprite(spriteNum).rect > put "Rect = " & rect >end > > >on doit1(me) > put spriteNum >end > >on doit2(me) > put me.spriteNum >end > >on setIt(me) > spriteNum = 7 > rect = sprite(me.spriteNum).rect > put "Rect = " & rect >end > >______________________________________ > > >Now, from the message window... > >-- "StartUp Rect = rect(11, 87, 61, 152)" > >sendSprite(1, #doit1) >-- 1 > >sendSprite(1, #doit2) >-- 1 > >sendSprite(1, #setIt) >-- "Rect = rect(-142, -4, -142, -4)" > > >So, you can see that the property spriteNum value has been set to 7, yet >the sprite is in channel 1. This is an undesirable situation that is very >easily avoided by not using key words as properties. >sprite(me.spriteNum).rect is straightforward to use but has become >convoluted due to the usage of keywords as properites. > >Why set oneself up for the error for the possibility of this trouble? It >is just as easy to use... > >property pSpriteNum >property pRect > >and keep me.spriteNum alone and happy. > >Regards, >Kraig >[To remove yourself from this list, or to change to digest mode, go to >http://www.penworks.com/lingo-l.cgi To post messages to the list, email >[EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L >is for learning and helping with programming Lingo. Thanks!] [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]