"IF" condition not evaluated correctly

I have an IF condition that checks if a global variable, “TvTableLocked” is equal to 1. When the code is executed I see that the debugger shows the variable is equal to 1; however, the condition is not evaluated to true. I tested this by playing a sound in the ELSE branch and when the code is run, the sound is played. Here is a screen shot of the code with the debugger info:

Any help is appreciated: