Works without problems here. I press the message box and there is 1. Then I press a key from my midi keyboard, and while holding that press the message box again and the output is still 1. If I stop pressing the note on my midi keyboard, 0 is output from the if statement, then if I press the message box again, 1.#INF is output which is the case when you divide things with 0. So works in the way it is supposed to work here. win XP 4.5.5.