希望xs录入数字为201或以上时,得到xs-200的结果,但结果却是101。说明有条件拦截。但我没明白是为什么被拦截?同时,也了解一下应用类似这样的多条件同时要满足的语句(如ElseIf XS > 101 And XS < 200 And txt2.text = "0" And txt1.text = "0" Then),编写应注意些什么?如何编写才是合理的?
Dim XS As Integer = val(txt3.text)
If val(txt1.text) = 1 And XS = 101 Then
ls2("H") = XS - 100
ElseIf val(txt1.text) > 1 And XS = 101 Then
ls2("H") = XS - 100
ElseIf XS = 101 And txt2.text = "0" And txt1.text = "0" Then
ls2("H") = XS - 100
ElseIf XS > 101 And XS < 200 And val(txt1.text) = 1
ls2("H") = XS - 100
ElseIf XS > 101 And XS < 200 And val(txt1.text) > 1
ls2("H") = XS - 100
ElseIf XS > 101 And XS < 200 And txt2.text = "0" And txt1.text = "0" Then
ls2("H") = XS - 100
ElseIf XS > 200 And val(txt1.text) = 1
ls2("H") = XS - 200
ElseIf XS > 200 And val(txt1.text) > 1
ls2("H") = XS - 200
ElseIf XS > 200 And txt2.text = "0" And txt1.text = "0"
ls2("H") = XS - 200
End If
End If