Recursion warning: what's the owner of a background?

Peter Brigham MD pmbrig at gmail.com
Thu Dec 23 14:30:33 EST 2010


On Dec 23, 2010, at 9:59 AM, David Bovill wrote:

> Peter, not shure if I got you right?  Why not take:
>
> word 1 to 3 of the long id of theObjectRef

Well, word 1 to 3 of theObjectRef gives:

field id 1072

since theObjectRef looks something like:

field id 1072 of group id 1052 of group id 1057 of group id 1004 of  
card id 1009 of stack "PDdata" of stack "/Users/pmbrig/Documents/ 
Revolution stacks/ PtData-rev/ Psychopharmica.rev"

but I want to extract the short name of group id 1004, the last one  
before the card. I could have parsed the long id by replacing " of "  
with comma, finding the itemoffset of "card id" and subtracting 1, but  
for whatever reason at the time* I chose a recursive function, and it  
works fine.

-- Peter

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

* alas, I too often find myself saying, "It seemed like a good idea at  
the time...." Story of my life, in scripting, at least.






More information about the use-livecode mailing list