>> The question is: what is the meaning of the characters "me" as in
>> "me.spriteNum", or "p" as in "pModel"? When does one use these?
>> Thanks in advance!

The first part of your question has been answered, so I'll tackle the second
part. "p" as in "pModel" is a naming convention that many of use to indicate
properties (similar to "g" as in "gScore" for a global variable). It's a way
to easily identify the type of variable. "p" or "g" have no inherent
importance in Lingo. In fact, "me" is also a convention - you could write a
behavior that substitutes "you" for "me" and it would work just fine - in a
behavior or parent script handler, the first argument is always the
behavior's (or object's) address in memory, no matter what that argument is
named. This is why a lot of people get hung up when trying to write
behaviors for the first time. If you have a handler in your behavior that
takes an argument, such as a property setting handler:
---------
property pMyAnswer

on mSetAnswer me, myAnswer
  pMyAnswer = myAnswer
end

on mGetAnswer me
  return pMyAnswer
end
---------
If you left out the me in the handler (on mSetAnswer myAnswer), the myAnswer
argument will recieve the behavior's address in memory as its value. So, the
mGetAnswer handler would return the correct value in the first case, but
would return the behavior's address in memory in the second case - causing
confusion. Hopefully I've not caused confusion.

-Kurt


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/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!]

Reply via email to