setprop handlers for custom property sets

Mark Wieder mwieder at ahsoftware.net
Thu Jul 30 18:44:09 EDT 2015


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.

-- 
 Mark Wieder
 ahsoftware at gmail.com






More information about the use-livecode mailing list