Global Variable in Eventing function

Related to this topic. I have another question

Is it possible to do it?