Bug???? Discuss please!

Bernard Devlin revolution at knowledgeworks.plus.com
Wed Nov 15 15:42:42 EST 2006

Mark said:
I would say this is a bug indeed. The message is sent, the handler
MessageY runs, both paths are followed as expected, but "the target"
and "me" are empty, while "the long id of me" is not empty.

When I run this on 2.7.4 on OS X, me is not empty on entry into the  
message handler on the closed card.  Try putting

answer "me=" & me && "in MessageY"

in the handler for the field on card 2.  I find that "me" is  
evaluating to "MessageY" inside that handler - and nothing to do with  
the long id of the field.  But getting hold of the field via "the  
long id of me" does work.   So it is almost as though "me" is the  
actual message received by the handler, whilst "the long id of me" is  
a pointer to the field in which the handler lives.

Just to show that this is what seems to be happening, you can also  
put "me" into a custom property - in that same handler, add this line

set the cp of the long id of me to me

And it is clear that "me" and "the long id of me" are very different.

Another oddity is that with card 1, if the field is empty when the  
button is clicked, then "me" is not "MessageX", but is instead empty  
when you try to answer using it as I am doing with the MessageY  
handler above.

So here is the script I have in both handlers:

  answer "long id =" && the long id of me & return & "me="&me && "in  
  set the cp of the long id of me to me
  put MessageY into me --note, I'm using the message itself not a  
string constant

Obviously, MessageY needs to be changed to MessageX in that handler..

Here's what I've found: when the button and the field are on the same  
card "me" inside the handler is empty (as evidenced by what will be  
in the cp of the field).  However, if the message is sent to card 2  
from card 1 then "me" will be "MessageY", and nothing will be put  
into the field (probably because "me" is not a reference to the  
field").  However, even though MessageX is empty in the handler of  
the field or card 1, "MessageX" still gets put into the field.

Surely this is weirder than anyone expected?


More information about the Use-livecode mailing list