Saving standalone substacks

James Hurley jhurley0305 at
Wed Dec 16 16:04:43 EST 2009

>> James Hurley wrote:
>> Actually, I had recalled that the splash screen was the way to go.  
>> My question is really quite primitive. When the user quits, or just  
>> wants to save the substacks, what is the action plan, specifically,  
>> what is the code? Save.....the substacks name. Is a file path  
>> required? Like I said, my question is quite primitive.
> Jacqueline Landman Gay wrote:

> Depends on what your stack does. If you've changed the  
> defaultfolder, then you'll need to calculate a file path back to  
> your satellite stacks I don't like the word "substacks" in this case  
> because those are stacks embedded in the mainstack, and they can't  
> save data. Separate stacks opened by a splash app need a different  
> name.) The default location when your splash starts up is the same  
> folder as the splash app is in. You can handle this several ways:
> 1. Reset the defaultfolder to the one where your splash exists, if  
> you've changed it. Refer to satellite stacks by their relative path.
> 2. Calculate file paths to the satellite stacks and use those as  
> stack references.
> 3. Set the stackfiles property of your splash so that it points to  
> relative path locations for the satellite stacks. Then you can just  
> refer to them by their short names and Rev can still find them. This  
> is perhaps the easiest way to manage it.
> However you determine the stack paths, the rest is the same. Loop  
> through the names of your satellite stacks when the user requests to  
> quit, and save each one. You can ask the user if they want to save  
> each of them, if that fits your app better.
> Assuming three stacks in the same folder as your standalone, with  
> the defaultfolder set to that directory:
> on shutdownRequest repeat for each item i in  
> "stack1.rev,stack2.rev,stack3.rev" save stack i close stack i end  
> repeat pass shutdownRequest end shutdownRequest
> -- 
> Jacqueline Landman Gay |  jacque at HyperActive  
> Software |

Thanks Jacque. That is VERY helpful.

Things I didn't know:

1)  I thought I would be saving to a substack.
2)  I was unaware of the "shutDownRequest" handler.

Another question or two.

1)  How would  "StackRunner" differ from using my own splash screen?
2)  How would "Revolution Player" differ from using my own splash  
3)  If I use "save" verses "save as..." can I assume that the  
satellite stack will be saved and the user will not be asked  if he or  
she wants to overwrite the existing file?

More information about the Use-livecode mailing list