setprop handlers for custom property sets

Paul Dupuis paul at researchware.com
Thu Jul 30 19:10:06 EDT 2015


On 7/30/2015 7:00 PM, Scott Rossi wrote:
> Maybe I'm missing something, but I originally thought the following would
> cause a recursion error, because the property being set appears within a
> setProp handler of the same name.  Trying this in LC 7.0.5 works, but I
> still see a warning in the docs about recursion.  So does the following
> work only in LC 7 and later?
>

Scott,

The recursion issue is of you have a pair (or more) or setProp handlers
that call back to one another: ie.

setprop propA pValue
  set the propA of me to pValue
  set the propB of me to pValue / 2
end propA

setProp propB pValue
  set the propB of me to pValue
  set the propA of me to pValue * 2
end propB

The 1st line of each is okay - setting the actual custom property value
in it's own handler will not cause recursion
However, the 2nd line will result in run-away recursion.




More information about the Use-livecode mailing list