On Jul 30, 2015, at 4:34 PM, Mark Wieder wrote: > Paul Dupuis <paul@...> writes: > >> >> The LC 6.7.5 dictionary entry for setProp has the following: >> >> If the custom property you want to control is in a custom property set, >> use array notation in the first line of the setProp handler, as in the >> following example: > > Interesting. I do see that in the documentation, but I've never used that. > The way I've always dealt with custom property sets is to switch context: > > set the customPropertySet of <object> to <name> > set the <property> of <object> to <whatever> > get the <property> of <object> > set the customPropertySet of <object> to empty > > I think this makes for a cleaner, easier-to-read format anyway.
I use these, an easy and modular approach: on setCustomProp pObjRef, pPropSet, pProp, pValue -- modeled after deleteCustomProp -- not sure where this comes from put the custompropertyset of pObjRef into oldPropSet set the custompropertyset of pObjRef to pPropSet set the pProp of pObjRef to pValue set the custompropertyset of pObjRef to oldPropSet end setCustomProp function getCustomProp pObjRef, pProp, pPropSet -- modeled after deleteCustomProp -- not sure where this comes from -- if pPropSet = empty then uses the default custompropertyset put the custompropertyset of pObjRef into oldPropSet set the custompropertyset of pObjRef to pPropSet put the pProp of pObjRef into tValue set the custompropertyset of pObjRef to oldPropSet return tValue end getCustomProp on deleteCustomProp pObjRef, pProp, pPropSet -- not sure where this comes from, it's not mine -- thanks to <whoever> ! put the custompropertyset of pObjRef into oldPropSet set the custompropertyset of pObjRef to pPropSet put the customkeys of pObjRef into keysList set the wholematches to true put lineoffset(pProp,keysList) into propLine if propLine <> 0 then delete line propLine of keysList set the customkeys of pObjRef to keysList end if set the custompropertyset of pObjRef to oldPropSet end deleteCustomProp -- Peter Peter M. Brigham pmb...@gmail.com http://home.comcast.net/~pmbrig _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode