Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
MaxV
- Posts: 1580
- Joined: Tue May 28, 2013 2:20 pm
-
Contact:
Post
by MaxV » Mon Oct 27, 2014 2:56 pm
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
put the folder into curfolder #save where are we now
set itemDel to "/"
set the folder to item 1 to -2 of (the effective fileName of this stack)
put item -1 of the filename of this stack into fname #just the name
if (fname & "_vers") is not among the lines of the folders then
create folder (fname & "_vers")
end if
set the folder to (the folder & "/" & fname & "_vers")
put the number of lines of the files into nVers
put URL ( "binfile:" & the effective fileName of this stack ) into URL ("binfile:" & nVers & fname)
set the folder to 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
-
FourthWorld
- VIP Livecode Opensource Backer

- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
-
Contact:
Post
by FourthWorld » Mon Oct 27, 2014 3:18 pm
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?
-
MaxV
- Posts: 1580
- Joined: Tue May 28, 2013 2:20 pm
-
Contact:
Post
by MaxV » Mon Oct 27, 2014 4:11 pm
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
-
FourthWorld
- VIP Livecode Opensource Backer

- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
-
Contact:
Post
by FourthWorld » Mon Oct 27, 2014 4:29 pm
Was the support team able to determine the cause of the corruption?
-
MaxV
- Posts: 1580
- Joined: Tue May 28, 2013 2:20 pm
-
Contact:
Post
by MaxV » Tue Oct 28, 2014 9:57 am
I recovered my works, so I didn't post any bug report.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
-
FourthWorld
- VIP Livecode Opensource Backer

- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
-
Contact:
Post
by FourthWorld » Tue Oct 28, 2014 2:47 pm
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.
-
jacque
- VIP Livecode Opensource Backer

- Posts: 7393
- Joined: Sat Apr 08, 2006 8:31 pm
-
Contact:
Post
by jacque » Tue Oct 28, 2014 5:01 pm
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
-
MaxV
- Posts: 1580
- Joined: Tue May 28, 2013 2:20 pm
-
Contact:
Post
by MaxV » Tue Oct 28, 2014 6:05 pm
Stack corruption happened to me working on the same stack for hours and hours.
However now I have my weapons against it.

Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
-
jacque
- VIP Livecode Opensource Backer

- Posts: 7393
- Joined: Sat Apr 08, 2006 8:31 pm
-
Contact:
Post
by jacque » Tue Oct 28, 2014 6:50 pm
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