Ask to Save

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
lohill
Posts: 770
Joined: Tue Dec 08, 2009 6:37 pm

Ask to Save

Post by lohill » Wed Feb 24, 2016 4:08 pm

While working in the IDE, what is it that causes the message "Do you want to save changes to stack "XXX" and all other stacks in the file "XXX" before closing?". Some stacks always ask even when you have done nothing to them. Is there a way I can force that to be quiet? I have a stack that I often open because it contains cards with code samples. The stack doesn't even have open and close scripts. If I just open it and then close it I get asked if I want to save.

Thanks,
Larry

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10324
Joined: Wed May 06, 2009 2:28 pm

Re: Ask to Save

Post by dunbarx » Wed Feb 24, 2016 4:22 pm

Hi.

Trap the "saveStackRequest" message in the stack script. The save will not take place unless this message makes it to the engine.

Craig Newman

EDIT.

Hmmm. This does not actually prevent the dialog, only prevents saving.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10324
Joined: Wed May 06, 2009 2:28 pm

Re: Ask to Save

Post by dunbarx » Wed Feb 24, 2016 4:43 pm

Well, here is a kluge.

In the stack script, in an "openStack" handler:

Code: Select all

on openStack
save this stack
end openStack
This will save the stack automatically each time you open it. But it costs you nothing, especially if you close your eyes. and if you really do not do anything but navigate the stack will not try to save yet again.

Craig

lohill
Posts: 770
Joined: Tue Dec 08, 2009 6:37 pm

Re: Ask to Save

Post by lohill » Wed Feb 24, 2016 6:06 pm

Thanks Craig - the 'save' works like a charm. I'm OK with kluges, I just thought there would be something more elegant. Does this problem ever happen to anyone else? I see it every once in a while.

Larry

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: Ask to Save

Post by Thierry » Wed Feb 24, 2016 6:14 pm

lohill wrote: I just thought there would be something more elegant.
Larry
Larry,
You might look at setting your stack as a plugin...

Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

lohill
Posts: 770
Joined: Tue Dec 08, 2009 6:37 pm

Re: Ask to Save

Post by lohill » Thu Feb 25, 2016 2:48 am

Thanks Thierry,

I had never tried that before but I made it a user plug-in and it does just what I want.

Larry

Post Reply