Save data or custom properties

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

sirobchGA0cda
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 47
Joined: Wed Dec 21, 2011 10:42 am
Contact:

Re: Save data or custom properties

Post by sirobchGA0cda » Sun Feb 02, 2014 9:30 am

Jacque thank you for your reply and explanation.
I think I begin to understand the difference between save stacks and save datas.
For my application I create a satck with a choice of languages​​, an English and a French button.
Changing the language in the fields is done by the custom properties that are in the Stack property inspector (see image)
And it is this choice that I'd like to save when I quit and relaunch the application.

Concerning the savings of stacks, I added in the PreOpenStack:
"wait 5 milliseconds with messages" after "save temp"
and now it's working.
but I'm not sure if this is the best solution
Best regards
Boris
Attachments
Capture d’écran 2014-02-02 à 09.19.29.png
My application "GeoMaths" is available on Itunes and Google Play !

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Save data or custom properties

Post by jmburnod » Sun Feb 02, 2014 10:52 am

Hi Jacque,
Thank you for explanation
I never used stack to save data.

Boris,
Yes, I can help you and you can help me

Best regards

Jean-Marc
https://alternatic.ch

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Save data or custom properties

Post by jacque » Sun Feb 02, 2014 8:40 pm

sirobchGA0cda wrote: Concerning the savings of stacks, I added in the PreOpenStack:
"wait 5 milliseconds with messages" after "save temp"
and now it's working.
but I'm not sure if this is the best solution
Best regards
Boris
I don't think waiting 5 milliseconds will fix the duplicate card issue. But you are right that saving only the custom properties is a much better way to do it. You can continue to use your data stack. The script should check to see if the data stack already has those properties. If not, you do not want to load them into the main stack because then the main stack properties will be empty. If the data stack does have the properties then the script should go ahead and load them. When the main stack closes, it should write the properties to the data stack always.

To load the properties from the data stack:

Code: Select all

set the anglais of stack "main" to the anglais of stack "data" -- use the real names of your stacks
To update the data stack when the main stack closes:

Code: Select all

set the anglais of stack "data" to the anglais of stack "main"
See if you can figure out how the handlers should be written. Remember to check for empty properties in the data stack before using them on launch.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

sirobchGA0cda
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 47
Joined: Wed Dec 21, 2011 10:42 am
Contact:

Re: Save data or custom properties

Post by sirobchGA0cda » Sun Feb 02, 2014 9:43 pm

Thank you Jacque for your answer.
I will tested with your proposition.
Boris
My application "GeoMaths" is available on Itunes and Google Play !

Post Reply