Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 80307

Re: Help with IF statement

$
0
0

There are a few things wrong.
First,
value = G10;
needs to be in quotes if G10 is really a string
value = "G10";
Otherwise the compiler will think it an undeclared variable.

 

Next, this is a boolean true / false
if(value)

 

should be a string check

 

if(value != null)

 

Next,

 

x = value;

 

That is a value of an Object to a String.

 

Could be

 

x.value = value;

 

And last,
if ( x < G10)
this is incorrect because the less than sign wont work
with strings unless the are a numeric value and using parseFloat or parsInt to compare them

 

This would be in the ball park.

 

if ( x.value != "G10")

 

or if both values were numeric you could use

 

if ( parseFloat(x.value) < 10)

 

HTH


Viewing all articles
Browse latest Browse all 80307

Trending Articles