I know it sounds like a bad after-school special Soon, but admitting you have a problem is the first step!
Phantastica has great points. It sounds like you are using food to help you deal with your pain--I know that feeling all too well!
The best way to deal with this next time is to start now in planning ways you can deal with your feelings that don't involve food. I've found that journaling is a good way for me to deal with my feelings. Using online journals (like the ones here at 3FC) is great, since you also get feedback and support. Many of the ways I can cope are things I can't do at work or during a busy day, like going for a way, getting on the elliptical, or painting. But some do--like venting to a friend/coworker, acknowledging my feelings and processing them logically in my head, and spending time in nature (depending on where I am).
Figure out what works for you, Soon, and then start applying it regularly! By the time something really upsets you, you'll have your contingency plan in place and be ready to react in a healthy way!
BTW, in case this is something you feel is a big pattern for you and you want to do more work in this area, you might consider joining Overeaters Anonymous. You can learn more about them at
www.oa.org