Weirdness Passing Messages

Mark Smith mark at maseurope.net
Thu Mar 23 08:56:36 EST 2006


On the other hand, given the function below, it might be more  
efficient for the calling handler to do the work, since it already  
knows the the long name and has the data. I mean that if a handler is  
going to send a message to a control, along with some data, it can  
certainly perform whatever actions are required, itself.

> function PutDataIntoMe theLongName,theData
>   do "put theData into " & theLongName
> end PutDataIntoMe


In your original example:

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.

Since putMessage knows the location, and has the data, it can do the  
work itself, avoiding any context issues altogether.

There may be other issues I don't know about, of course, but I'm sure  
you see what I mean.

Mark


On 23 Mar 2006, at 13:03, David Burgun wrote:





More information about the use-livecode mailing list