Page 1 of 1

How to get the name of a stack where a component is?

Posted: Fri Nov 27, 2009 10:50 am
by ale870
Hello,
I need to know the name of stack which contains a button. I need to make it in the button self.
I can use <<the long name of button "xyz" >> but I need to "parse" the name to find the stack name. Is there a shorter way?

Thank you!

Re: How to get the name of a stack where a component is?

Posted: Fri Nov 27, 2009 11:25 am
by ale870
UPDATE: Now I se the following code:

Code: Select all

local myStack  -- Stack name containing this button.
local myTmp1  --  Generic temporary variable.

-- Get stack name containing this button.
--
put the long name of me into myTmp1
put word (wordOffset("stack",  myTmp1)+1) of myTmp1 into myStack
replace quote with empty in myStack
Don't forget to eliminate the double quotes using the last "REPLACE", else it will not work!