Launched stack does not keep all changes

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
mrcoollion
Posts: 738
Joined: Thu Sep 11, 2014 1:49 pm

Launched stack does not keep all changes

Post by mrcoollion » Mon Sep 21, 2015 7:31 am

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
Last edited by mrcoollion on Tue Oct 13, 2015 6:02 pm, edited 1 time in total.

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Launched stack does not keep all changes

Post by Klaus » Mon Sep 21, 2015 1:38 pm

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

mrcoollion
Posts: 738
Joined: Thu Sep 11, 2014 1:49 pm

Re: Launched stack does not keep all changes

Post by mrcoollion » Mon Sep 21, 2015 3:26 pm

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
Attachments
FolderAndResults01.zip
(130.14 KiB) Downloaded 234 times

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Launched stack does not keep all changes

Post by Klaus » Mon Sep 21, 2015 4:27 pm

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

mrcoollion
Posts: 738
Joined: Thu Sep 11, 2014 1:49 pm

Re: Launched stack does not keep all changes

Post by mrcoollion » Mon Sep 21, 2015 6:25 pm

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
Attachments
AnswerAfterSaveStack.zip
(26.74 KiB) Downloaded 213 times

Post Reply