Page 1 of 1

Custom Properties not being saved

Posted: Fri Nov 02, 2012 5:47 pm
by Newbie4
I have a main stack - "Classes" and another stack "Student Form" I have created custom properties in the secondary stack. Everything works fine and data is preserved between running the program in LiveCode. But when I create a stand alone, the data is not preserved between executions of the program. Do I need to do something special for the stand alines to save the data?

Re: Custom Properties not being saved

Posted: Fri Nov 02, 2012 5:54 pm
by sturgis
When you create your standalone, substacks are saved as part of the executable. Since an executable can't change itself this is why a standalone doesn't save settings. To get around this create 2 separate mainstacks, under the "files and folders" tab of the standalone preferences (I think thats what its called) you can add the 2nd stack for your properties as a file to include when building.

This way when you build the standalone it will place the 2nd stack next to the executable at which point you can load it into memory from the main stack, modify it, save it, whatever you need to do.

Look at this lesson for more info. http://lessons.runrev.com/s/lessons/m/4 ... pplication

It details the "splashstack" method, but the concept is the same. 2 stacks, 1 that gets build into the executable, another that is loaded at runtime.