If you are transferring OnEnter to OnExit then you don't want to use a global variable. In APP, global variables are not sensitive to the format state which means you can end up with strange results in certain cases.
What APP traditionally uses for this type of storage are the "format safe" counters and FISH. In v10 M070 and above, Javascript variables (but not Javascript objects) will also be format safe.