How to prevent backup copy from taking over?

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
sritcp
Posts: 431
Joined: Tue Jun 05, 2012 5:38 pm

How to prevent backup copy from taking over?

Post by sritcp » Tue Aug 25, 2015 2:37 pm

I have a project file, say, myproject.livecode
I open it, work on it, and at some point click a button which saves a backup copy named my project-datetimestamp.livecode in a different folder (say, dropbox).
I work on the stack some more, save by hitting command-S, and quit Livecode.
When I open LiveCode again, my project.livecode contains none of the edits of the previous session.
The backup copy contains all of them. This means I have to replace the original with the backup copy before proceeding.
It seems when I save a backup copy, the current stack ceases to be the original stack but points towards the backup copy.
This is quite annoying and could lead to inadvertent errors.

How do I correct this behavior?

Thanks,
Sri

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

Re: How to prevent backup copy from taking over?

Post by Klaus » Tue Aug 25, 2015 2:44 pm

Hi Sri,

I ususally create a tiny stack (as palette) for my projects with one button with a script like this:

Code: Select all

on mouseUp

   ## Save original stack file:
   save stack "myproject"

   ## Create filename with timestamp:
   put "myproject" & the seconds & ".livecode" into tFile
   put the filename of stack "myproject" into tSource

   ## Copy saved stack to backup or Dropbox folder:
   put url("binfile:" & tSource) into url("binfile:" & "path to dropbox/or backup folder/here/" & tFile)
end mouseUp
You get the picture :D


Best

Klaus

sritcp
Posts: 431
Joined: Tue Jun 05, 2012 5:38 pm

Re: How to prevent backup copy from taking over?

Post by sritcp » Wed Aug 26, 2015 12:08 am

Hi Klaus:

Thanks for the idea.
I guess there is no in-built way to do this in LC, so we need workarounds.
It would be nice if LC had a menu option "Backup" which would back up the current stack in the default back up folder with the default suffix (such as date stamp).

Regards,
Sri.

Post Reply