How I recovered scripts from a corrupt stack

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 539
Joined: Sun Dec 18, 2011 7:23 pm
Contact:

How I recovered scripts from a corrupt stack

Post by kaveh1000 » Sat Jul 19, 2014 10:22 pm

Hi folks. I had a stack that had not been backed up for 3 days. All of a sudden every time I launched it LiveCode (latest version on Mac) crashed. Luckily almost all my handlers were in the stack script. I opened the stack in a text editor (BBedit) and very easily found the script, and copied and pasted into an old backup. So this is just a pointer to people who might have a similar problem.

Having said that,
• Is there a way to have regular backups saved thro' LiveCode?
• Any other tricks to recover a corrupted stack?
Kaveh

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: How I recovered scripts from a corrupt stack

Post by Simon » Sat Jul 19, 2014 11:50 pm

Hi Kaveh,
In Development > Plugins > revSmartSav
I think that ships with the product.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10058
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: How I recovered scripts from a corrupt stack

Post by FourthWorld » Sun Jul 20, 2014 1:25 am

File corruption is very rare with LiveCode. The most common symptom is the IDE reporting that the file is corrupted; other symptoms may mean other causes.

When you say "crash", what exactly is happening? Does the OS report an error? Or is LiveCode simply quitting? Or something else?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 539
Joined: Sun Dec 18, 2011 7:23 pm
Contact:

Re: How I recovered scripts from a corrupt stack

Post by kaveh1000 » Sun Jul 20, 2014 10:54 am

I open the stack and it shows up for a split second (sometimes for 2-3 seconds) and the whole card seems to be selected, with selection marks around the card. Then app quits and I get "the application unexpected quits".

After your question I tried something...

My LiveCode always opens with the pointer tool selected. I don't know how to have it on browse tool by default. (I asked this question elsewhere.) When I open LiveCode, then choose browse tool before opening the stack, it does not crash, and it seems to operate normally, except that the 8 selection markers as visible, as if the card was selected – markers at the extreme edges of the card. But as soon as I select the pointer tool (sometimes pointer then browse again) it quits again.

The problem is solved as I have salvaged the scripts, but be good to know for future. Thanks all.
Kaveh

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

Re: How I recovered scripts from a corrupt stack

Post by jacque » Sun Jul 20, 2014 5:30 pm

This sounds very similar to a crash I got in a stack with many large images. The amount of RAM required was more than LiveCode could handle. Since you're seeing selection handles around the card borders, it sounds like you have a card size background image.

If the stack contains many large images, it isn't enough to just hide the ones not in use because even hidden images will be cached. If that fits your situation, use referenced files on disk instead of imported images. Images on disk aren't loaded into memory until they are displayed.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply