I alsoavoided functions with alcohol as much as possible initially. If it wasn't possible I ate before I arrived (hunger lowers my defences, I think it's a blood sugar thing) and left very early.
Keeping a journal of how you feel is a good reminder. I took a photo of myself and that sure put me off a few times when I was tempted!