Custom Properties not being saved

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Newbie4
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 332
Joined: Sun Apr 15, 2012 1:17 am
Contact:

Custom Properties not being saved

Post by Newbie4 » Fri Nov 02, 2012 5:47 pm

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?
Cyril Pruszko
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Custom Properties not being saved

Post by sturgis » Fri Nov 02, 2012 5:54 pm

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.

Post Reply