2

I am using a field [all scores] as a parameter agricultural classification. I tried using field calculator (VB script) with many kinds script, but it never works and giving me notification 99999, syntax error.

I use this pre-logic.

Dim output
    If [all_score]>45 and [all_score]<80 then
        output="Dryland" 
    ElseIf[all_score]>79 and [all_score]<87 then
        output="Agricultural Wetland"
    ElseIf[all_score]>86 and [all_score]<137 then
        output="Plantation"
    Else
        output="Non- Agricultural"
    End If

Can someone tell me what I'm missing here?

  • Did the answer match what you were looking for? If so, please accept it. Thanks!! – Hélène Jun 12 '17 at 9:08
2

I would trying using parentheses:

    Dim output
        If ([all_score]>45 and [all_score]<80) then
            output="Dryland" 
        ElseIf ([all_score]>79 and [all_score]<87) then
            output="Agricultural Wetland"
        ElseIf ([all_score]>86 and [all_score]<137) then
            output="Plantation"
        Else
            output="Non- Agricultural"
        End If

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.