setProp Recursion

Pete pete at mollysrevenge.com
Mon Nov 28 19:39:55 EST 2011


Thanks.  Yes I saw a mention of lock messages in another place in the
manual that didn't seem to apply to my circumstance but that seems to have
fixed the problem.
Pete

On Mon, Nov 28, 2011 at 3:11 PM, Mark Schonewille <
m.schonewille at economy-x-talk.com> wrote:

> Pete,
>
> Try lock messages or pass xyz.
>
> setProp xyz theValue
>  lock messages
>  set the xyz of me to theValue
>  unlock messages //optional
> end xyz
>
> setProp xyz theValue
>  put somethingElse into theValue
>  pass setProp
> end xyz
>
> Frankly I'm not entirely sure that the second example works. I think I did
> something similar though. The first example should work. If the setProp
> handler is not in the target, then setting that property for that target
> may cause recursion. So, probably it isn't a bug.
>
> --
> Best regards,
>
> Mark Schonewille
>
> Economy-x-Talk Consulting and Software Engineering
> Homepage: http://economy-x-talk.com
> Twitter: http://twitter.com/xtalkprogrammer
> KvK: 50277553
>
> Become our partner in sales http://qery.us/1bq Start selling Color
> Converter today. 20% commission!
>
> On 28 nov 2011, at 23:51, Pete wrote:
>
> > I have a setProp handler that refers to its own custom property, eg
> >
> > setProp xyz pvalue
> > ...
> > ...
> > ...
> > set the xyz of the target to "abc"
> > ...
> > ...
> > ...
> > end xyz
> >
> > According to the Reference manual "If you use the set command within a
> > setProp handler to set the same custom property for the current object,
> no
> > setProp trigger is sent to the target object" (to avoid runaway
> recursion).
> > However, the first time this setProp handler is invoked, I get the LC
> > message that the recursion limit has been reached.
> >
> > Either this is a bug or I'm misunderstanding the manual....
> >
> >
> > --
> > Pete
> > Molly's Revenge <http://www.mollysrevenge.com>
>
>
>
> _______________________________________________
> 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
>
>


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



More information about the use-livecode mailing list