main stack and substack questions
Sarah Reichelt
sarah.reichelt at gmail.com
Fri Mar 30 18:11:16 EDT 2007
> But I would like to click a button in substack 1 to open substack 2 and when
> I click the button pass name of substack 1 and the card name that is
> currently open to substack 2 so that I am able to get info from flds within
> open card in substack 1, I hope this explains it better?
OK, I get it now. The simplest way might be to use global variables.
In your button on substack 1, have this script:
on mouseUp
global gStack, gCard
put the short name of this stack into gStack
put the short name of this card into gCard
go to stack "sub2"
end mouseUp
Then in the card or stack script of 2:
on openCard
global gStack, gCard
put fld "newrecord_id" of card gCard of stack gStack into fld "record_id"
end openCard
This method gives you access to that card & stack any time, but if you
only need to get the data once, then you could just put the data into
substack 2 before going to it e.g.
on mouseUp
put fld "newrecord_id" into fld "record_id" of stack "sub2"
go to stack "sub2"
end mouseUp
Cheers,
Sarah
More information about the use-livecode
mailing list