Page 1 of 1

Get name of mainstack from substack

Posted: Sun Nov 09, 2014 7:01 pm
by Tribblehunter
Hi all.

Stuck on something that seems simple but I must be missing something!

I need to get the name of the mainstack from a substack. But can not seem to get the grammar correct.

this code is in the substack on preOpenStack

get the name of the mainStack of me

but it fails. Any help appreciated

Got it! was being silly.

But now i can't reference mainstack from substack

get the cVersion of the mainstack of this stack

Definately got coders block!

Re: Get name of mainstack from substack

Posted: Sun Nov 09, 2014 7:09 pm
by LCNeil
Hi Tribblehunter,

Get puts a value from an expression into the it variable, so you will have to reference this in your script.

Also, the correct syntax that you are looking for should be the following :) -

Code: Select all

on preOpenStack
   get the mainstack of me
   put it
end preOpenStack
Kind Regards,

Neil Roger
--
LiveCode Support Team ~ http://www.runrev.com
--

Re: Get name of mainstack from substack

Posted: Sun Nov 09, 2014 7:15 pm
by Tribblehunter
Thanks. You gave me the solution and also nudged my brain to get the next solution!

Re: Get name of mainstack from substack

Posted: Tue Nov 11, 2014 2:19 pm
by Da_Elf
another useful one to use is "owner"[*]

Code: Select all

put the owner of me into grpName
answer "The group I am in is "&grpName

Re: Get name of mainstack from substack

Posted: Tue Nov 11, 2014 10:17 pm
by Mark
Hi,

Sometimes, it isn't practical to get the mainstack of me. In such cases, you can use the long id.

Code: Select all

put the long id of me into myVar
put "stack" && the last word of myVar into myStack

put the long id of the target into myVar
put "stack" && the last word of myVar into myStack
Kind regards,

Mark