Avoiding recursion with a setProp handler

Dave Cragg dcragg at lacscentre.co.uk
Mon Aug 23 14:11:07 EDT 2004


On 22 Aug 2004, at 18:53, depstein at att.net wrote:

> MC 2.5's help stack says that "when you set an object's property from 
> within a setprop handler, setprop messages are not sent."  Is this 
> true?
>
> Here's my handler:
>
> setProp beenChanged whether
>   put the short date  into fld 3
>   set the beenChanged of this stack to whether -- (without this, the 
> setProp handler intercepts the calling command, and the property is 
> not set)
> end setProp
>
> When some other handler commands "set the beenChanged of this stack to 
> true", my setProp handler gets called.  But when I watch the message 
> watcher, it appears that the second line of my setProp handler is 
> recursively calling the setProp handler, and I get a "recursion limit 
> reached" error.
>
I use this technique a lot, and have seen no recursion problems so far.

There's something wrong with your handler (the last line should be "end 
beenChanged") but I'm assuming that's a typo.

Is it possible the "this stack" reference in the handler is not 
pointing to where you expect? But I can't imagine how this would cause 
your problem. Just to check, you could try replacing "this stack" with 
"me".


Cheers
Dave



More information about the metacard mailing list