5 Replies Latest reply on Oct 12, 2010 4:07 PM by Devtron

    How to check if variable (of type uint) has a value or not?

    mike_morales Level 2

      Hello all,

       

      I'm just trying to write a conditional statement to check whether my uint variable has a value or not.  I tried checking both 'null' and 'undefined' but with no luck (see below)

       

      private var _tempIndex:uint;

      ...

      ...

       

      if(_tempIndex != null){

           // code here

      }

       

      got an error with that one, then tried

       

      if(_tempIndex != undefined){

           // code here

      }

       

      got an error with that as well.

       

      So, how do I check if a variable has been assigned a value or not? Any ideas? Thanks in advance!

       

      Mike