Have a go at writing the if statement yourself, then show us.
There must be thousands of examples of how to use the if statement and write conditional expressions on the web.
Ok, thanks, but how can I add a letter "G" to check in a "IF stament"?
I cant write this:
if(NewValue < G50)
So how can I fix it in this:
public var NewValue:Object;
public var Value:String;
var Value:String = event.data.readUTFBytes(event.data.bytesAvailable);
NewValue = Value;
if(NewValue < 50)
I don't understand what you're trying to do and you're still using incorrectly named variables.
ok, I got a value "G100" comming in thru USART, I want to be able to read this in a "IF statement"
Something like this, but it wont allow me this since its a Object, and it needs to be a Object.
Is that better to understand?
public var newValue:Object;
if(NewValue < G100)
G100 is a string so what kind of comparison are you trying to do?
I know its a String, but that wont work either.
Get this error then:
I just want to check if value "G100" is reached, then do something else...
Multiple markers at this line:
-Access of undefined property G100
-1120: Access of undefined property G100.
I think I'll let someone braver than me try and help you.
I will only try to answer the first question, because I couldn't understand the later questions.
> I want to check for numbers in a "IF statement". Say if I got 0-10000 as a value, I want to only check for value between 1000-10000.
if (1000 <= value && value <= 10000)