Time for action – creating a data save stack
We're going to make a copy of a stack, but only if another copy of that stack doesn't exist. LiveCode has a nice if there is a…
function, which was made for times like this!
First, we will create the stacks we'll need by following these steps:
- Start a new Mainstack with the name
LaunchStack
. Save it somewhere other than your computer'sDocuments
folder. - Start another new Mainstack with the name
AppStack
. Save it in the same folder as the first stack. - Place some data on each stack's card, so that you can easily recognize when you're in that stack. For example, drag a button onto the card of the
LaunchStack
stack and name it in a way that makes it very easy to recognize. Do the same for theAppStack
stack. - Put the following
openStack
handler in the stack script ofLaunchStack
:on openStack set the defaultFolder to specialFolderPath("Documents") if there is not a file "AppStack.livecode"...