Hi,
Using Pro 3.x; writing Attribute Rules. I've got an expression that it keeps saying that it needs a close parenthesis. I've put this expression into Notepad ++ and it shows the matching parenthesis. Doesn't seem to be any missing. Is this perhaps a false message and I'm missing something else? I am actually trying to mine the data in the comments field looking for each of those words/phrases (except I don't want the comments that have both STORMWATER and LIFT in them. I did try those on the previous if statement, didn't work there either. Any help appreciated, cause I'm just not seeing it.
Thanks,
Lorinda
var comments = $feature.Comments
var ckcomments = $feature.CheckComments
var discount = $feature.Discount
if (discount > 42) {
ckcomments = 'Y';
}
else if ((Find("WASTELAND",comments,0) >-1) || (Find("SUBMERGE",comments,0) >-1) || (Find("LAKE BOTTOM",comments,0) >-1) || (Find("POND",comments,0) >-1) || (Find("HOA",comments,0) >-1) || (Find("ZERO",comments,0) >-1)) {
ckcomments = 'Y';
}
else if ((Find("STORMWATER",comments,0) >-1) && (Find("LIFT",comments,0) = 1)) {
ckcomments = 'Y';
}
else {
ckcomments = 'N';
}
return ckcomments;
Solved! Go to Solution.
To post formatted code:
Your check for LIFT is wrong. You use =, which is for assignment. You either want to use == for comparison, or (more probable) you want to use the same check > -1 you used for the other words.
To post formatted code:
Your check for LIFT is wrong. You use =, which is for assignment. You either want to use == for comparison, or (more probable) you want to use the same check > -1 you used for the other words.