Weirdness Passing Messages

David Burgun dburgun at dsl.pipex.com
Wed Mar 22 14:28:09 EST 2006


Hi,

Update:

If I put a breakpoint in Card2:ObjectX on the statement:

put "MessageY" into me

and then press the button in Card1:ObjectA and when I hit the  
breakpoint use the App Browser Window to manually select Card2 (so  
that it is shown instead of Card1, then the field is set to  
"MessageY" as expected, so it looks like the fact that the message  
handler is being called when Card2 is not selected is causing the put  
statement to not work!!!

Any Ideas??
Cheers
Dave

Hi,

function ListenForMessages theMessageID,theHanlderLocation

Adds to an Array (stored in a GlobalProperty of StackUtil) as so:

MessageArray[theMessageID] =  theHanlderLocation

If theMessageID is already in the Array and the Location is not  
already in the data part of the array, then it is appended, so the  
array looks like this:

    Key                      Data
"MessageX"          ObjectX of Card 2 of Stack "StackMain",ObjectY of  
Card 2 of Stack ""StackMain"

and is called like so:

ListenForMessages("MessageX",the long name of me)


function PutMessage theMessageID

Looks up theMessageID in the Array built in ListenForMessages and  
calls (via a "send" statement) the handler with the name theMessageID  
at the location(s) specified in the data part of the array.

As I said the Message handling functions seem to work fine in  
general, but not when PutMessage() is called from within a message  
handler OR when called from a different card that the one that called  
the initial message. Not sure which!

Thanks a lot
All the Best
Dave

On 22 Mar 2006, at 19:02, Mark Smith wrote:

> What do these functions do?
>
> Mark
>
> On 22 Mar 2006, at 18:51, David Burgun wrote:
>
>> PutMessage()
>> ListenForMessages()
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list