Want to add Backup of Stack to my BGS Library

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderator: Klaus

Post Reply
BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Want to add Backup of Stack to my BGS Library

Post by BarrySumpter » Sat Mar 24, 2012 1:45 am

BGS Lib.gif
If you might recall we developed a stack for me for command short cuts as pic'd above.

I'd like to add anothe funtion to backup my project.

After 12 months of continued confusion I think I've finally come up with a stardard way that works for me.

I've started with setting the Close the File option when Closing the last stack in file:
This way I know its removed from IDE memory.
LC Preferences - Close the File.gif
I've also arranged my projects here:
RunRev Folder.gif
Last edited by BarrySumpter on Sat Mar 24, 2012 2:03 am, edited 1 time in total.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Want to add Backup of Stack to my BGS Library

Post by BarrySumpter » Sat Mar 24, 2012 2:01 am

I've also run a test to sort out what LiveCode IDE is doing on a save and save backup.

Pretty much the save just saves over the top of the last save.
So If I save a backup:
Save As.gif
The Next save just saves over the top of my last backup.

BUT the next Save as .... default file name DOES NOT change when saving as a different file name.
So when I Save as... the default file name stays as the orignal file.
Save as 2.gif
Making me think the IDE has been saving my work properly in that file name.
But it hasn't.
Its been saving my work over the top of the last saved as file name.
Which was my last backup file name.
To me, I feel like this is still an error. And very confusing.
i.e. the Save as... default file name AND path should be the last file name AND path I saved under.


So to combat this now after 12 months of confusion I:
1) save as... the new backup stack
2) save as... again as the original stack

---

So, I'd like to create a command to to Back Up
Which will:
1) retrieve the file name of my current stack
2) retreive the folder of my current stack
3) Create a BU folder if its not alreay there using the folder path from step 2
4) save my stack as the file name from step 1 under the BU folder from step 3 as the next backup in this format:
myStack_BU5.livecode or could even be myStack_BU 2012 03 04 1159.LiveCode
5) save my stack again as the original stack name on the original folder from step 1 and 2
6) set the next Save as ... folder to default to my current folder from step 2 - may be redundant
7) make sure the default file name on the next Save as ... is the original file name from step 1 - may be redundant
tia
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Want to add Backup of Stack to my BGS Library

Post by jacque » Sat Mar 24, 2012 7:39 pm

I'd just do it like this:

Code: Select all

put <path to backup folder> into tBUPfolder -- assumes it ends with a slash
if there is no folder tBUPfolder then create folder tBUPfolder
put the filename of this stack into tSourceStack
put tBUPfolder & the short name of this stack && the seconds into tDestStack -- add seconds or whatever to keep filename unique
put url ("binfile:" & tSourceStack) into url ("binfile:" & tDestStack)
Edited to fix backup path.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Want to add Backup of Stack to my BGS Library

Post by BarrySumpter » Sun Mar 25, 2012 2:54 am

Thanks jaque!
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

Post Reply