Messages in setprop...

Dave Cragg dcragg at lacscentre.co.uk
Thu Nov 24 17:07:03 EST 2005


On 24 Nov 2005, at 22:27, Gilberto Cuba wrote:

> Hi,
>
> I'm working in a "setprop" of the "property set", that is to say,  
> group of property, and detect that I modified or set a value of a  
> property of the same group or "property set", the message dont  
> triggered. How I can do this message occur?
>
> Example:
>
> setprop MyPropSet[propName] newValue
>
> switch propName
> case "Prop1"
>   -- (1)
>   set the MyPropSet["Prop3"] of me to value
>   break
> case "Prop2"
>   ...
>   -- do something...
>   ...
>   break
> case "Prop3"
>   ...
>   ...do something...  (2)
>   ...
>   break
> end switch
>
> end setprop
>
> When i set a value to a property "Prop1", it come in to (1), but  
> when the next line is executing, it dont pass for (2).
> I hope you might understand.

The following is from the Rev documentation under "setprop".

"If you use the set command within a setProp control structure to set  
the same custom property for the current object, no setProp trigger  
is sent to the object. (This is to avoid runaway recursion, where the  
setProp handler triggers itself.)"

I assume this also applies with "property set" handlers too.

Depending on what you are wanting to do, there are probably a number  
of ways to get round this. My first suggestion would be to use a  
regular handler or function instead of a setprop handler.

Cheers
Dave



More information about the use-livecode mailing list