Detect when a field changes

Monte Goulding monte at sweattechnologies.com
Mon Nov 18 15:12:57 EST 2013


On 19/11/2013, at 6:45 AM, Richard Gaskin <ambassador at fourthworld.com> wrote:

> So cool - thanks, Momte!
> 
> Has there been any discussion of a possible enhancement to lockMessages, so we can lock all system message EXCEPT getProp and setProp?
> 
> I'd like to use those triggers, with since they're affected by lockMessages I can't use them for critical tasks except under very well defined circumstances.

No there hasn't. Perhaps raise it on the forum. I recently decided there should be an unlockMessages message that custom controls and cards are sent so they can check themselves for initialisation if they happen to be now on an open card and didn't know about it etc... Although if everybody did that perhaps it makes lock messages redundant.

The good thing with custom properties is even with messages unlocked it's always possible to get at them without triggering the handlers by getting/settings the whole set. The other thing that occurs to me is perhaps the use case where you definitely want the scripts to fire is different to the one you don't so perhaps it would simplify backwards compatibility if it were possible to declare the setProp/getProp as required somehow rather than changing lock messages itself.

I'm not sure about the name but something like:

local sMyProp

virtual getProp uMyProp
   return sMyProp
end uMyProp

virtual setProp uMyProp pValue
    put pValue into sMyProp
end uMyProp

Cheers

--
Monte Goulding

M E R Goulding - software development services
mergExt - There's an external for that!








More information about the use-livecode mailing list