# How can I check a variable with an If statement?

**URL:** <https://forum.kirupa.com/t/how-can-i-check-a-variable-with-an-if-statement/211487>\
**Category:** flash\
**Created:** [January 2, 2007, 6:58am UTC](https://forum.kirupa.com/t/how-can-i-check-a-variable-with-an-if-statement/211487 "2007-01-02T06:58:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Soig](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@Soig](https://forum.kirupa.com/u/Soig)\
**Post date:** [January 2, 2007, 6:58am UTC](https://forum.kirupa.com/t/how-can-i-check-a-variable-with-an-if-statement/211487/1 "2007-01-02T06:58:53Z")

</div>

The title says it all. How can I check a variable with an If statement?

> Assuming that the variable name is xVar.

if(xVar == “abcde”){  
trace(“Stop Typing ABCDE!”);  
}

Clearly this is wrong. Does anyone know the right way to do this??
