How do I save changes to fields and scripts in Standalone

J. Landman Gay jacque at hyperactivesw.com
Thu Oct 29 17:25:06 EDT 2009


DunbarX at aol.com wrote:
> I ran into this. As someone said to me, "don't fret, nobody can save to a 
> single stack standalone".
> 
> You have to have a "mainstack" be a sort of splash screen, or it can even 
> be invisible to the user. Substacks, or any other stacks (I do not think they 
> have to be actual substacks, as long as they are in the stack file), can 
> then be saved. So you never actually use the "mainStack" for anything except 
> as an umbrella for the real, working "substacks".

It's the opposite. No substacks can be saved if they are in the main 
stackfile. "Substack" is a specific Revolution term; it means a stack 
that is embedded in the same file on disk as the main stack. Nothing in 
that stackfile can be saved once it is turned into a standalone.

The rest of what you say is true. Turn the mainstack into a standalone, 
and then use it to open other, separate stacks on disk. A stack that is 
not part of the main stackfile will save just fine.

Some Rev terminology, just for clarity:

Stackfile: a single file on disk, which contains a main stack and 
optionally any number of substacks.

Mainstack: the primary stack in a stackfile. If a stackfile contains 
only one stack, it is also the mainstack of the stackfile. If the file 
contains several stacks, only one can be designated as the mainstack. 
When a stackfile opens, the mainstack is what is displayed.

Substack: a separate stack that is embedded into the same file on disk 
as a mainstack. One advantage here is that it can always be found by the 
mainstack or the Rev engine because the entire stackfile loads into RAM 
when a file is opened, which means substacks are always loaded into RAM 
when the mainstack does. The destroystack property has no effect on 
these stacks; they always remain in RAM, though when closed they are not 
in the message path.

Satellite stack: not an official term, but what I personally call other, 
separate stacks on disk that are not part of the main stackfile. 
Satellite stacks are not loaded into RAM unless a script or user 
specifically opens them; in fact, Rev doesn't know they exist until they 
are opened. When they are closed, their status in RAM depends on whether 
their destroystack property is set to true or false. If true, the stack 
is wiped from RAM when it closes.

Some people like to keep all their stacks together in a single stackfile 
for convenience during development. When it is time to save a 
standalone, there is an option in Standalone Settings to separate 
substacks into individual (satellite) stacks on disk. This allows the 
mainstack to save data to its satellite stacks once it becomes a 
standalone. However, note that since the satellite stacks are no longer 
part of the stackfile, some file path calculations may be necessary in 
order to find and open them by script, depending on what your standalone 
does and where they are stored.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list