jumping among Mainstack and substacks isn't easy

Bob Sneidar bobs at twft.com
Mon Jun 18 17:34:06 EDT 2012


On Jun 18, 2012, at 2:16 PM, Robert Brenstein wrote:

> On 18.06.2012 at 12:03 Uhr -0700 Bob Sneidar apparently wrote:
>> I'm not entirely sure this is the issue, but let me describe how Livecode interprets your code. When you say "field boy", Livecode translates that to "field "boy" of the current card of the topstack" (others will correct me if I am wrong). LC allows you to do this for the sake of brevity in coding, so you do not have to spell out the full path to every object in order to use it. But it's something you need to keep in mind when you being to navigate to different cards in a script.
> 
> Not topstack but defaultstack. Usually these are the same but not always. Also, when a script navigates to a new card/stack, its context will stay with the old card/stack by default.

hmmm... If by context you mean that if I go to a card in another stack and get the name of this card, it will return the name of the card I came from and not the card  I went to, I think you are mistaken, but I may have misunderstood you. I tested this by opening a new stack and putting this script in a new button:

ON mouseUp pMouseBtnNo
    go stack "CSL Launcher"
    put the name of this card
    go back
END mouseUp

I got the name of the current card in stack "CSL Launcher" (an app I am creating). 

Bob



More information about the Use-livecode mailing list