Try the isNaN() method:

if (isNaN(Number(loc[0])))

however, shouldn't you be using parseInt() or parseFloat() instead of
Number()? Casting a String as a Number is a risky thing to do at the
best of times!

So try:

if ((isNaN(parseInt(loc[0]))||(isNaN(parseInt(loc[1])))
  return;

HTH,
   Ian

On Thu, Oct 30, 2008 at 1:48 PM, Eric E. Dolecki <[EMAIL PROTECTED]> wrote:
> if( Number(loc[0]) == NaN || Number(loc[1] == NaN )    return;
>
> Warning: 1098: Illogical comparison with NaN.  This statement always
> evaluates to false.
>
> Okay, so I have also tried
>
> if( loc[0] == NaN || loc[1] == NaN )
>    return;
>
> I get the same error. loc[0] 99.9% of the time is a string value of a number
> (ie. var loc:Array = msg.split(" ")). Sometimes it ends up NaN, I want to
> prevent NaN from going through to a later method. I would have thought I
> could simply check that for NaN.
>
> ??
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to