Variable transfers Between Stacks and Sub-Stacks.

Sarah Reichelt sarah.reichelt at gmail.com
Thu Mar 29 07:52:15 EDT 2007


> So I've a main stack and sub-stack for preferences. I save and load
> the variables as a stack (not text of xml - just yet) when I open and
> close the substack. However, is there best practice for how to load
> the variables on startup of the mainstack and then use them in the
> mainstack - refereshing if people change the preferences (in the sub-
> stack) while the application is running?

If the data in the sub-stack is stored in a field, then it's really easy:
   put field "Data" of stack "Sub" into myVariable

The mainStack always "knows" where it's sub-stacks are and can grab
data from them directly.

There is no need to use global variables (which are persistant and
will not respond to change unless you script it), just use field data
and retrieve it every time you need it. That way any changes will be
implemented automatically.

Cheers,
Sarah



More information about the use-livecode mailing list