JScript (like most other languages borrowing from C) has the switch statement, which seems appropriate for what you want to do, especially if you are testing for more than three cases. Documentation can be found here.
quote:Originally posted by Dennis Mike
f(color == 'red'){
Debug.Trace("red")
}
elseif(color == 'blue')
{
Debug.Trace("blue")
}
elseif(color == 'green')
{
Debug.Trace("green")
}
that won't work... A switch statement would be good for this, but if you want to use an if statement it would be something like this (this is shortened):
code:if(color == "red"){
// color is red
} else if(color == "blue"){
// color is blue
}