jumping among Mainstack and substacks isn't easy
rjb at robelko.com
Mon Jun 18 17:16:44 EDT 2012
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.
@Mark: the solution for you is to extend the object reference to
include the stack, so instead of
get fld "boy"
get fld "boy" of stack "indexstack"
This works for fetching the custom properties as well. Like
get the mycustomproperty of fld "boy" of card 10 of stack "indexstack"
Mark, you should also look at the dialogData global property. It is
handy to pass data when switching stacks.
More information about the Use-livecode