setprop handlers for custom property sets

Paul Dupuis paul at researchware.com
Thu Jul 30 19:02:00 EDT 2015


On 7/30/2015 6:44 PM, Mark Wieder wrote:
> Paul Dupuis <paul at ...> writes:
>
>> it does correctly execute the setProp handler. Much to my surprise. This
>> implies that you can NOT have two custom property sets that have the
>> same property name IF you want to use setprop or getProp handlers with them.
> No, that's the point of the custom property sets.
> They act like vocabulary switchers.
> So you can have
>
> setProp myUniqueName pValue
>   add 1 to pValue
>   set the myUniqueName of me to pValue
> end myUniqueName
>
> in one custom property set and
>  
> setProp myUniqueName pValue
>   set the myUniqueName of me to "$" & (pValue / 100)
> end myUniqueName
>
> in another custom property set
> and then use whichever is appropriate at the time.
> It's a very powerful tool once you get the hang of it.
>

Am I missing something else Mark? How do you put a setProp handler in a
customPropertySet? The handlers have to be in scripts. Do you use
behaviors to switch between setprop handlers?




More information about the use-livecode mailing list