Difference between Mainstack and Substack

J. Landman Gay jacque at hyperactivesw.com
Thu Jan 10 14:05:19 EST 2013


On 1/10/13 8:31 AM, Graham Samuel wrote:

> Another very important use of substacks is to allow them (or the data
> in them) to be changed by the user. In all modern operating systems,
> self-modifying programs are forbidden, which means if the user
> changes (say) some fields in your mainstack, when the app finishes
> those changes can't be preserved unless the app intervenes and puts
> the changes in a file somewhere. From the OS's point of view, one can
> prepare a standalone program as just a mainstack, with substacks
> outside it (this is the 'splashscreen' method).  In this structure
> there is no restriction on modifying a substack and just saving it as
> a whole whenever you want to preserve the changes.

True, but once the stacks are saved as separate files, they are no 
longer "substacks". There's been some confusion in the past with the 
terminology so just to clarify: a "substack" is a stack that has been 
saved in the same file on disk as the mainstack. If the mainstack is 
compiled into an app, its substacks also cannot save data to themselves.

The standalone builder has an option to remove the substacks from the 
mainstack and save them out as separate files. That way those files can 
be opened by the app, altered and saved. However, at that point they are 
not substacks any more, they are mainstacks. I call them "document 
stacks" or "satellite stacks", or even just "stacks", but I try not to 
call them "substacks" to avoid confusion.

Picky point I know, but it can throw new users.

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




More information about the use-livecode mailing list