Hi,
I want to share this code with you. Place it in your mainstack and you'll have always all version backups in a separate folder:
########CODE####### on saveStackRequest putthefolderinto curfolder #save where are we now setitemDelto"/" setthefoldertoitem1to -2 of (theeffectivefileNameofthisstack) putitem -1 ofthefilenameofthisstackinto fname #just the name if (fname & "_vers") isnotamongthelinesofthefoldersthen createfolder (fname & "_vers") endif setthefolderto (thefolder & "/" & fname & "_vers") putthenumberoflinesofthefilesinto nVers putURL ( "binfile:" & theeffectivefileNameofthisstack ) intoURL ("binfile:" & nVers & fname) setthefolderto curfolder #revert back to the original folder pass saveStackRequest -- or the stack won't be saved end saveStackRequest #####END OF CODE#####
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Very handy script. Versioning is valuable for a great many reasons, but I haven't seen many cases of stack file corruption. What percentage of your stacks have been corrupted? Was the team able to determine the cause after you'd submitted it with your report?
Richard Gaskin LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
I had stack corruption 2-3 times in 6 months. The last time I risked to lost a lot of work. I usually works on Dropbox, that it has file versioning in its standard configuration.
However some software can't be on dropbox or other cloud service for many reasons, so I needed to found another solution.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Whenever you find an instance of stack file corruption it's very helpful if you can submit a support request for it. One of the reasons LiveCode has so few instances of either file corruption or memory leaks is that those types of issues tend to get immediate and deep attention. Once the team can see where the stack broke they may be able to isolate the circumstance that led to it, and prevent it from happening altogether.
Richard Gaskin LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
MaxV wrote:I had stack corruption 2-3 times in 6 months. :
Were you opening the stack in different versions of LiveCode? It can report corruption when you do that, if you were saving in 7.0 and then opening it in 6.x. It isn't real corruption, it's just the difference in file formats.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
Okay, then please do report it. You will save a lot of people a whole lot of trouble if you can help out with this. I know the RR team really wants to squash these things, and we'll all be very grateful.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com