setProp and Lock messages

Todd Geist todd at geistinteractive.com
Sat Dec 3 12:35:51 EST 2011


Hi Mark

Thank you for taking the time to respond. Perhaps I didn't ask the question
correctly, but as far as I can tell your example does address the question
I was asking.


On Sat, Dec 3, 2011 at 9:08 AM, Mark Schonewille <
m.schonewille at economy-x-talk.com> wrote:

> The example I gave you in my previous e-mail works.



Take a look at this example.

On doSomething

   lock messages

   set the cProp of me to 3

end doSomething



setProp cProp x

   lock messages



   if x = "a" then

      set cProp of the target to x

   else if x = "b" then

      set the cProp of the target to x

   end if



end cProp


I have written a setProp to only handle accept certain values, ("a" and "b"
).  The DoSomething handler represents  "Some other code" that attempts to
set the property.  Since it has set locked messages, the setProp is ignored
and values other than a and b can be set.

That is what I am talking about.

This seems to me to be a pretty big problem.  How can I ever be sure that
setProp and GetProp handlers will actually be used.  I may not have control
over all the code and there might be a lock messages somewhere up the chain.

Todd



More information about the use-livecode mailing list