Ditto. If you're smart, this only happens to you once. If you're me, then maybe twice 
Now I ALWAYS compile THEN save altered code BEFORE running code that involves loops, and a little less frequently during normal coding, but I still compile and save frequently. I do it in that order on the premise that there's no point in saving it if it doesn't compile anyway..
Maybe others don't find this humorous, but check out post 4 here elsewhere in this forum. It might help you to remember to save often.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.