setProp and Lock messages

Pete pete at mollysrevenge.com
Mon Dec 5 12:25:27 CST 2011


No I don't think you're missing anything - I am :-)

I'm sure what you said is correct although I haven't tried it.  The example
in the manual regarding the use of lockMessages seems to relate to a
setProp handler at the stack level to handle a custom property used by all
cards in the stack.  My poor brain can't discern why that would result in
recursion since the example specifically sets the custom property of the
target which presumably would be the card from which the set command
originated.

Anyway, I agree we're pretty much talking about the same thing but we kinda
got off the topic of documentation discrepancies.  Turns out my assertion
that the use of lock messages in a setProp handler isn't a documentation
error - I just happened to read one of the reference manual notes about it
instead of all of them, my bad.

I'm still trying to figure out what to do regarding the use of setProp
handlers and the likelihood of lock messages being true when they are
called.  In a self contained application it's just a case of careful coding
habits but in the case of a library of handlers provided for the use of
other developers, there is no control over what another developer might do
in their own code before calling a handler in the library that issues a
setProp command, other than make it very clear that setting lock messages
to true might produce "unexpected results".  I'm leaning towards abandoning
setProp/GetProp in favour of the localised handler approach(which I use
elsewhere in my library for other purposes.

The dictionary entry for lock messages doesn't exactly inspire confidence
either:

"Sets the lockMessages property to true, preventing setProp triggers,
getProp calls, and certain messages from being sent."

Which "certain messages"?

On Mon, Dec 5, 2011 at 9:39 AM, Richard Gaskin
<ambassador at fourthworld.com>wrote:

>
> In my pre-coffee state it seems we're looking at the same thing, with one
> small but important distinction:
>
> Recursion will not occur if the setProp handler for a given property label
> sets the value of a property using that label, BUT if it calls any other
> handler which sets that property then recursion will occur.
>
> Did I miss something?
>
>
> --
>  Richard Gaskin
>  Fourth World
>  LiveCode training and consulting: http://www.fourthworld.com
>  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
>  LiveCode Journal blog: http://LiveCodejournal.com/**blog.irv<http://LiveCodejournal.com/blog.irv>
>
>
> ______________________________**_________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/**mailman/listinfo/use-livecode<http://lists.runrev.com/mailman/listinfo/use-livecode>
>
>


-- 
Pete
Molly's Revenge <http://www.mollysrevenge.com>


More information about the use-livecode mailing list