[GIS] Field Calculator syntax

arcgis-desktopfield-calculatorvbscript

I can't get the syntax correct for a fairly simple if statement. Right now it looks like this:

dim Output as Integer
If [HECTARES] >= 30 AND [HEIGHT] >= 17 AND [CROWN] >= 59
 THEN Output = 1
 ELSE Output = 0
END IF

I have no idea whether that's the correct use of "AND" but the expression wouldn't evaluate with only one expression (i.e. [HECTARES] > 30) either.

Thoughts?

Best Answer

Try this under the Field Calculator advanced option.

Dim Output as Integer 
If [HECTARES] >= 30 AND [HEIGHT] >= 17 AND [CROWN] >= 59  Then
Output = 1

else
Output = 0 
end if

I've gotten this syntax to work with my data.