on 04-18-2007 2:54 PM
I am gettting a syntax error on the below code in bold. Can someone show me how to alleviate this error?
if (BLineRunning == 'YES' && BWeldEnd > 0);
/grid.setCellColorAsString(1,1, "red");/
grid.setCellBackgroundColorAsString(1,1,"red");
else if (BLineRunning == 'YES');
<b>if (BWeldEnd > BUSCenters || BCenter > BUSCenters || BHoldEnd > BUSCenters);</b>
grid.setCellColorAsString(1,2, "red");
else
grid.setCellColorAsString(1,2, "green");
Not sure your sequence or indentation (if any), but if you have an "if" and an "else if" you also need a final "else".
So you could have this:
if (BLineRunning == 'YES' && BWeldEnd >0)
grid.setCellBackgroundColorAsString(1,1,"red");
else (BLineRunning == 'YES')
if (BWeldEnd > BUSCenters || BCenter > BUSCenters || BHoldEnd > BUSCenters)
grid.setCellColorAsString(1,2,"red");
else
grid.setCellColorAsString(1,2,"green");
Also, don't use semicolons on the "if", "else if", or "else" lines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Or you could do it like this:
if (BLineRunning == 'YES') {
if (BWeldEnd > 0) {
grid.setCellBackgroundColorAsString(1,1,"red");
} else {
if ((BWeldEnd > BUSCenters) || (BCenter > BUSCenters) || (BHoldEnd > BUSCenters)) {
grid.setCellColorAsString(1,2,"red");
} else {
grid.setCellColorAsString(1,2,"green");
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
10 | |
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.