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

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
ale870
Posts: 250
Joined: Tue Apr 22, 2008 9:17 am
Contact:

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

Post by ale870 » Fri Nov 27, 2009 10:50 am

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!
Runtime Revolution Widgets, tutorials, tips & tricks and more!
http://runrevwidgets.com/wiki

ale870
Posts: 250
Joined: Tue Apr 22, 2008 9:17 am
Contact:

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

Post by ale870 » Fri Nov 27, 2009 11:25 am

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!
Runtime Revolution Widgets, tutorials, tips & tricks and more!
http://runrevwidgets.com/wiki

Post Reply