Extracting a reference to a stack
Richard Gaskin
ambassador at fourthworld.com
Sun Aug 9 12:26:32 EDT 2015
Mike Bonner wrote:
> Ok. Better way. Use a virtual getprop in a library stack
>
> getprop owningstack
> return (the name of this stack)
> end owningstack
>
> Then if you have the long id of an object you can do this..
> get the owningstack of myLongId
> and "it" will contain the stackname. (should also work inserted into
> front, right?)
An excellent suggestions, but suffers from a design limitation not of
your making: getProp and setProp are currently handled as system
messages, so when lockMessages is true they won't fire. This makes them
unpredictable except in cases where you have total control over all code
(no third-party libraries, and much discipline among team members). :(
Mark Waddingham has expressed the opinion that getProp and setProp
should be recategorized as custom handlers, and given how they're used
that seem quite reasonable. As custom handlers they'd be immune to
lockMessages.
If the engine were updated accordingly they'd become extremely valuable
in so many cases, but as they are I rarely use them.
I don't know when such a change would take place. I had hoped it would
be before now.
--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
More information about the use-livecode
mailing list