Extracting a reference to a stack

Peter M. Brigham pmbrig at gmail.com
Sun Aug 9 15:42:20 CEST 2015


Clever. But since the long id of the object is not used by the getprop handler, this always returns the name of the topstack, so it can't be used for more general situations, eg, if you want to get the owningstack of a control on a stack that is suspended.

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig


On Aug 9, 2015, at 2:43 AM, 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?)
> 
> On Sat, Aug 8, 2015 at 11:47 PM, Mike Bonner <bonnmike at gmail.com> wrote:
> 
>> This may not do things in the required way, but..  If you have a library
>> stack with a function or command that just grabs the name of "this stack"
>> then you can dispatch or send the request to the object and POOF it'll tell
>> you what stack its on, no parsing necessary.
>> 
>> Just tried it here, and it works fine.
>> 
>> On Sat, Aug 8, 2015 at 7:03 PM, Richard Gaskin <ambassador at fourthworld.com
>>> wrote:
>> 
>>> David Bovill wrote:
>>> 
>>>> Yes - you're right. The long name is the only case and like you I
>>>> only use long ids in the use cases I have. Except when I store
>>>> references when I use the ruggedID handler of the IDE - that should
>>>> be a native reference I think?
>>> 
>>> It would be nice to have an engine version of revRuggedID, or for that
>>> function definition to just be moved from revbackscriptlibrary to
>>> revcommonlibrary, since the latter is copied into every standalone so
>>> everyone would have it everywhere.
>>> 
>>> In fact, since both of those libraries are now text-only stacks, anyone
>>> sufficiently motivated could make the move and submit a pull request in
>>> github.
>>> 
>>> 
>>> --
>>> Richard Gaskin
>>> Fourth World Systems
>>> Software Design and Development for the Desktop, Mobile, and the Web
>>> ____________________________________________________________________
>>> Ambassador at FourthWorld.com                http://www.FourthWorld.com
>>> 
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>> 
>> 
>> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list