Re: Undefinded problem...
Only functions can return a value. You are looking for break.
Re: Undefinded problem...
Hello,
I have now done the following:
Code:
var ev_index = "001";
if (ev_index == "001")
{
return "hello";
}
else
{
break;
}
If the ev_index = 001 it works fine
but, If the ev_index = any other number it comes up with a Syntax error. (invalid break statement)
Am I using the break correct ?
Aaron.
Re: Undefinded problem...
No. It is not correct. As I said in my previous post, you cannot use return in a in if() statement. Only functions have returns. Hence why you are getting an undefined return.
But, why even bother checking the positive if you only want to check for a negative? Save yourself some code.
Code:
if (ev_index != "001") {
// do processing here
}