CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

[Solved] My Code is Gone

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
haxan7



Joined: 27 Jul 2013
Posts: 79

View user's profile Send private message

[Solved] My Code is Gone
PostPosted: Wed Aug 14, 2013 3:30 am     Reply with quote

Compiler Version 4.140.

I don't know what happened, i pressed ctrl+z, there was an error saying index out of bound or something like that. I pressed pressed ok, my code looked fine so i saved it. But it wasn't ok,Now the bottom 30 lines of code are intact but top 400 lines of code are gone :(

Is there any way i can recover my code?
Does ccs keep code backup somewhere.


Last edited by haxan7 on Wed Aug 14, 2013 3:41 am; edited 1 time in total
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

PostPosted: Wed Aug 14, 2013 3:34 am     Reply with quote

The question should be "Do YOU keep a backup somewhere?" Backups are very important, and shouldn't be left to compilers and IDEs to sort out for you.

You may be in luck however. Check for a .bak file in the directory where your source files are. There will be one for each source file that's modified. However, if you've already fiddled about trying to recover your code you may have already unknowingly overwritten it with a copy of your messed up code.
haxan7



Joined: 27 Jul 2013
Posts: 79

View user's profile Send private message

PostPosted: Wed Aug 14, 2013 3:40 am     Reply with quote

RF_Developer wrote:
The question should be "Do YOU keep a backup somewhere?" Backups are very important, and shouldn't be left to compilers and IDEs to sort out for you.

You may be in luck however. Check for a .bak file in the directory where your source files are. There will be one for each source file that's modified. However, if you've already fiddled about trying to recover your code you may have already overwritten it with a copy of your messed up code.


I do keep backups but my last backup was a day old.
Thank god for that .bak file, only 15 minutes worth of code gone.
I have got to start taking backups more frequently.
Thanks.
alan



Joined: 12 Nov 2012
Posts: 357
Location: South Africa

View user's profile Send private message

PostPosted: Wed Aug 14, 2013 4:07 am     Reply with quote

The UNDO function in the IDE are very buggy. I rather use MPLAB's IDE because of that. Not much improvement in Ver5 with the UNDO function. The best is to save before trying an UNDO. That worked for me couple of times.

Regards
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Aug 14, 2013 7:10 am     Reply with quote

Here's how I do backups...

1) create a directory based on the PIC type( 4550,16f84,etc.)
2) create the original baseline program,usually the 'flashing 1Hz' program, saving it as 'programnameV1.c'
3) create a project using it, saving as projectnameV1.pjt
4) confirm it works...

now...
copy 'old' programnameV1.c to 'new' programnameV2.c
create a new project, projectnameV2,using progrmnameV2.c
make changes to V2..test..save.

repeat as necessay V2,v3,V4,...v101 ! whatever is required.

the 'trick' is to make small changes,save,test that way you can easily go back to a known working program.Nothing is more frustrating than to make 3-4 changes,test, it fails,make a few more changes and really screw things up ! OR the power fails !!!!

Yes, my way takes up a lot of harddrive space but these days that's not a problem. You can always delete all but the last say 3 or 4 versions, once you're sure it's more or less working right.

hth
jay
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group