Page 1 of 1

Launched stack does not keep all changes

Posted: Mon Sep 21, 2015 7:31 am
by mrcoollion
Hope someone can help me with the next problem I encounter.

I am working on an application that adds cards within a stack (see post http://forums.livecode.com/viewtopic.php?f=8&t=25353)
I have got everything working fine and I use a launcher to start the application ( http://lessons.runrev.com/s/lessons/m/4 ... pplication ).

My problem is that if a user adds one card, the stack remembers that card between sessions fine, but when I use the import function that generates cards in a repeat loop, those cards are not remembered. Even though they do exists and are accessible during that session, when I close the application and start it up again the cards are gone ??? :shock:

tried putting 'save this Stack' in the repeat loop but no luck.

Can anybody explain to me what is going wrong?

(PS. this is actually an app I want to give to a customer so it must work flawless)

To test this make a launcher stack that starts the attached stack.
First add the necessary libraries in the standalone settings general of the launcher stack, also add the attached stack in the stacks section tab before you Save the stack as a standalone application to your build folder.

So you do not have to make dummy scripts to test with, I also added a zipped file with a folder and some dummy scripts that can be used to test the import feature.


If I cannot make this work I will be forced to rewrite the application and make use of a Database :?

Friendly regards,

Paul Agerbeek

Re: Launched stack does not keep all changes

Posted: Mon Sep 21, 2015 1:38 pm
by Klaus
Hi Paul,

the "average" user does not have write permissions in the OS application folder,
so SAVE THIS STACK will silently fail in that case!

Be sure to copy your user-editable stack to the users DOCUMENTS folder, when the app
starts for the first time, and everything should work fine!


Best

Klaus

Re: Launched stack does not keep all changes

Posted: Mon Sep 21, 2015 3:26 pm
by mrcoollion
Hi Klaus,

I did what you suggested but still the same result :? (see attached printscreen of folder).

It is in Dutch but as you can see it is a subfolder in my documents folder (D:\User Folders\Documents\Launcher3).

Regards,

Paul

Re: Launched stack does not keep all changes

Posted: Mon Sep 21, 2015 4:27 pm
by Klaus
Dag Paul,

OK, I was just guessing. :D
Add this right after you "save stack xyz"
...
answer the result
...
That should give you any hint on what might go wrong when trying to save.
It should be EMPTY on success.


Groetjes

Klaus

Re: Launched stack does not keep all changes

Posted: Mon Sep 21, 2015 6:25 pm
by mrcoollion
Hoi Klaus,

Tried the 'answer the result' statement direct after save this stack
And the result is empty (see attached screenshot)! So it seems that all has gone well.
However if I shutdown the application and start it up again the cards are gone ...

If I add only one card the stack remembers this card.... strange ....

To clarify: So everything goes ok except if I import multiple files and clone the cards in a repeat statement. In that case the cards are there and everything seems ok but when i close the application and start it up again the cards are gone...


Regards,

Paul