A whole nights coding lost
Miscellaneous Forums/General Discussion/A whole nights coding lost
I just spent the entire night coding a new project of mine, something I'm really excited about.
So excited that I couldn't sleep. So I grabbed my laptop to do a little more coding when I realized I made a horrible mistake; I never named the file, and exited out of blitz plus with it still labeled as untitled.
Usually, I save my work by running the program, which automatically saves all changes, so this is why I did what I did.
My question is, is this untitled blitz project saved anywhere where I can recover it, or is it lost forever?
Thanks
Try the "tmp" folder.
I haven't used blitzplus for years, but I think it had one.
BlitzMax saves unnamed files in the tmp folder under the BlitzMax folder. Blitz3D doesn't save any unnamed files, since it compiles them in the editor.
BlitzPlus and Blitz3D both have /tmp folders, so it may well be in there still, if you haven't run any new code since. (ie. C:\Program Files\BlitzPlus\tmp )
Yeah, don't run anything else. Just do as BlitzSupport suggests.
I already looked there, the only thing in there is some code I've never seen that was modified back in August of 2003.
I guess I'll just have to do it all over again :(
Thanks everyone.
You'll code it better the second time round anyway :)
Sauer, if I have read this right...
I just spent the entire night coding a new project of mine, something I'm really excited about.
OK, been there.
I never named the file, and exited out of blitz plus with it still labeled as untitled.
Ahhh, no problem. It will be in /tmp as people say but wait...
Usually, I save my work by running the program, which automatically saves all changes, so this is why I did what I did.
... this suggests you had NOT run the program... is that right?
.
Rob is right : you'll code it better next time but it might be worth a) saving regularly with versioning b) running your program every now and again.
A long time ago I wrote a 'project starter' program that I run first.
You give it a name, it creates a folder of that name in my projects folder, it then creates a couple of sub folders, mesh, gfx, sfx, screens, and create a stub of main.bb which puts a comment at the top of the project name and start date etc.
When I get home I'll stick it in the code archives, it's a tiny amount of code but quite handy.
No I had run the program, but I hadn't named it anything or saved it.
What I meant by that is when I'm working on a game and make a change, when you run it it saves the file. Otherwise, when you go to exit blitz, it prompts you if you want to save it.
So I ran this program right before I was about to exit out, to make sure everything was working right, then I exited out of blitz, and it didn't prompt me to save (I don't think). So I figured if it had saved it would be in the tmp file, yet there's nothing in there.
So I'm just going to take Robs advice, code it better, and make sure I give it a name FIRST THING.
It's not elegant... But it works!
ProjectName$="New Project"
CreateDir(ProjectName)
CreateDir(ProjectName + "\Mesh")
CreateDir(ProjectName + "\GFX")
CreateDir(ProjectName + "\SFX")
CreateDir(ProjectName + "\Screens")
fileout = WriteFile(ProjectName + "\Main.bb")
WriteLine( fileout, "; Project:" + ProjectName )
WriteLine( fileout, "; Created:" + CurrentDate() + " " + CurrentTime() )
WriteLine( fileout, "; History:" )
WriteLine( fileout, ";")
WriteLine( fileout, ";")
WriteLine( fileout, ";")
WriteLine( fileout, "; Things to do:")
WriteLine( fileout, ";")
WriteLine( fileout, ";")
WriteLine( fileout, ";")
WriteLine( fileout, "")
WriteLine( fileout, "Graphics3D 1024,768,32,2")
WriteLine( fileout, "")
WriteLine( fileout, "Global Camera = CreateCamera()")
WriteLine( fileout, "CameraZoom camera,1.6")
WriteLine( fileout, "light = CreateLight():RotateEntity light,45,45,0")
WriteLine( fileout, ";==========================================================================================================")
WriteLine( fileout, "; timing set up")
WriteLine( fileout, ";==========================================================================================================")
WriteLine( fileout, "ups=60")
WriteLine( fileout, "period=1000/ups")
WriteLine( fileout, "time=MilliSecs()-period")
WriteLine( fileout, "")
WriteLine( fileout, "Repeat")
WriteLine( fileout, "")
WriteLine( fileout, ";==========================================================================================================")
WriteLine( fileout, "; timing code")
WriteLine( fileout, ";==========================================================================================================")
WriteLine( fileout, "Repeat")
WriteLine( fileout, "elapsed=MilliSecs()-time")
WriteLine( fileout, "If KeyHit(1) Then End")
WriteLine( fileout, "Until elapsed >= 0")
WriteLine( fileout, "tic=elapsed/period")
WriteLine( fileout, "For k=1 To tic")
WriteLine( fileout, Chr(9) + "time=time+period")
WriteLine( fileout, "")
WriteLine( fileout, "")
WriteLine( fileout, "")
WriteLine( fileout, "")
WriteLine( fileout, "")
WriteLine( fileout, "")
WriteLine( fileout, "")
WriteLine( fileout, "")
WriteLine( fileout, "")
WriteLine( fileout, "")
WriteLine( fileout, "")
WriteLine( fileout, "")
WriteLine( fileout, "")
WriteLine( fileout, Chr(9) + "If KeyHit(1) Then End")
WriteLine( fileout, "Next")
WriteLine( fileout, "RenderWorld")
WriteLine( fileout, "Flip")
WriteLine( fileout, "Until KeyHit(1)")
CloseFile( fileout )
Ooo very nice thanks for that.
Are you sure you are looking in the right \tmp folder?
I just tried this and indeed nothing was in there. But then I remembered that I keep multiple installations of Blitz products. So I right clicked on the shortcut I used to run BlitzPlus and checked Properties to see where it was. Sure enough, it was actually a different install which I had entirely forgotten about. I don't use BlitzPlus very often.
Anyway, this other BlitzPlus\tmp folder contained tmp.bb, the little test program I had just tried.
If you really want to be thorough you could search your hard drive for files named *.bb saved in the last week or so.
You're still at school, aren't you Sauer, IIRC? When I was about 14, typed up a complete school project on my old Amiga not bothering to save as I went along; took HOURS. Just about to finish up when I kicked the power switch with my foot. Blammo! Not best pleased so I know how you feel.
It was all a dream :)
So I ran this program right before I was about to exit out, to make sure everything was working right, then I exited out of blitz, and it didn't prompt me to save (I don't think). So I figured if it had saved it would be in the tmp file, yet there's nothing in there.
Sounds like the program might have been saved, just not in the folder you're looking for it in.
Check 'My Documents' to see if there are any blitz files in there.
Check the 'Recent files' dropdown in the editor you used to see if it is listed there.
Create a dummy Blitz file, click the save button (don't follow through with the save), and see if you can find the file in the folder shown in the save window.
---
In future, when you start a project like this, make sure you name and save the files as soon as you create them. Save regularly after that.
I don't want to be harsh, but going an entire night coding without saving your files properly is mind-boglingly silly.
@ John Galt
Yes, I am in college right now, and if I experienced what you did there would be untold amounts of damage to my room and the computer.
And to all the others, I spent the day coding what I had lost and, as Rob already said, it is a LOT better. But I'm going to look for the old one just for fun at this point.
another option: Search the entire drive for files created in the past -x- days, that ought to dig up anything if it exists...
"One of my most productive days was throwing away 1000 lines of code." — Ken Thompson
Ever since I tried to make a fairly huge RPG in QBasic -ages ago- I save files every so many minutes. It's just a blind hand movement te learn, after which you do it automatically and unconsciously.
And yes: the second code attempt always 0wns the first one.. :P
When I was a kid I used to type in massive program listings from magasines and stuff, and I spent ages doing one on my spectrum and told me mum not to turn it off when I was at school because I hadn't saved it (saving on tape was a pain if you were in a hurry), and then I came back home later and lo and behold it was switched off. She said the PSU felt warm and was worried, so turned it off - ARG! :-)
Mothers are funny like that. I sent my mom into a nervous wreck when I built a computer inside of a cardboard box...
...ok well maybe she had good reason to be.
I save files every so many minutes. It's just a blind hand movement te learn, after which you do it automatically and unconsciously.
SOO true, nowadays just before I start thinking through the code I save it, my console gets flooded with "The ansi file ['...'.bmx] was saved to disk". (BLIde)