How to "save as" without problems?

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
Francesco77
Posts: 37
Joined: Mon Nov 16, 2020 8:16 pm

How to "save as" without problems?

Post by Francesco77 » Sun Nov 29, 2020 8:21 pm

I am not sure if this is a stupid question and probably I make some mistakes,

I ususally save my projects every hour or so under different names.

For example (with txt-extension):
"myProject-20-11-29a.txt"
"myProject-20-11-29b.txt
etc.

When trying this with my LC projects I get messages that say, that a LC with the same name is already open.
I am not sure why this happens. The normal windows behaviour in this case should be that one can continue to work with the current file under a the new name without problems.

Why does this confusing behaviour happen and how can i avoid it when using "save as"?

Thanks for your help.

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: How to "save as" without problems?

Post by SparkOut » Sun Nov 29, 2020 8:38 pm

The reason is because LiveCode identifies its stacks with the stack's "name" property. This is not the same as the filename. When you "save as" you create a new copy of the project with a new filename, but the stacj "name" doesn't change unless you explicitly change it.
The best way to deal with this is arguable. One simple way is to close LiveCode completely and restart, but it isn't very convenient. If you get a message dialogue asking whether you want to purge the conflicting file from memory then you can. You could try to change the stack name before saving. If I were to ask anyone for more definitive insight, I would go to jacque first.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: How to "save as" without problems?

Post by FourthWorld » Sun Nov 29, 2020 11:03 pm

I prefer to just keep working and make any backup copies in the file system.

I also copy to a separate volume, in case the problem I encounter is with the disk or the file system.

Now I have that automated: I use Nextcloud with my dev folder syncing to a the machine running Nextcloud. Now I not only get a remote backup each time I save, but they're also versioned and time-stamped so I can roll back to a specific version if needed. Bonus: I also have Nextcloud syncing on my other dev machines, so when I switch among them for testing and tweaking all of them stay in sync. I keep my Plugins folder synced the same way, so my tooling is identical no matter where I'm working.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Francesco77
Posts: 37
Joined: Mon Nov 16, 2020 8:16 pm

Re: How to "save as" without problems?

Post by Francesco77 » Mon Nov 30, 2020 8:17 am

Thank you very much for your answers and help. I think I understand now a bit better how LC works

For solution 1 (closing - copying and restarting):
Is there a way to store the state of the various tools (inspectors etc.) so that they are openend and positioned again when reopening a LC stack? At the moment it seems that I have to do that manually everytime I start LC.

For solution 2 (backing up the openend and running LC file):
Is that possible anytime no matter what is going on in the stack at that moment? I know that storing an openend file can cause a lot of problems in other applications (e.g. MS word etc.).

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: How to "save as" without problems?

Post by FourthWorld » Mon Nov 30, 2020 8:53 am

LC reads an entire stack file into memory, and writes it in one pass. So its I/O is about as clean as it can get.

I've been using copies triggered automatically by save via Nextcloud for many years, and manually copying the stack file for decades before. It works. And quite well.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: How to "save as" without problems?

Post by jacque » Mon Nov 30, 2020 6:27 pm

I usually do what Richard does, I duplicate the stack in the Finder (Explorer on Windows.) However, there used to be a plugin that auto-saves at intervals you specify. I'm not at my computer right now but check the plugin menu to see if it's still there. That's probably the easiest way to do it.

Edit: Back at the computer now, I see the plugin is still there. It's called revSmartSave. The longest interval it offers is 10 minutes, which may be too often for your workflow.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”