范围检查逻辑?

Range check logic?

如何在 VB6 中对此进行编码。我几乎已经明白了,但我不知道如何把它们放在一起。我在 VB6 中这样做。

If Incometxt >= 20962 Then StatusLbl = "Low-income class"
ElseIf Incometxt <= 20963 Then StatusLbl = "Lower middle-income class"
ElseIf Incometxt <= 41925 Then StatusLbl = "Middle middle-income class"
ElseIf Incometxt <= 73368 Then StatusLbl = "Upper middle-income class"
ElseIf Incometxt <= 125773 && = 2096200 Then StatusLbl = "Upper-income class"
Else Incometxt > 2096201 Then StatusLbl = "Rich"

我认为错误发生在我上面给出的代码的第 5 行和第 6 行。

试试这个:

If Incometxt <= 20962 Then
    StatusLbl = "Low-income class"
ElseIf Incometxt >= 20963 And Incometxt <= 41924 Then
    StatusLbl = "Lower middle-income class"
ElseIf Incometxt >= 41925 And Incometxt <= 73367 Then
    StatusLbl = "Middle middle-income class"
ElseIf Incometxt >= 73368 And Incometxt <= 125772 Then
    StatusLbl = "Upper middle-income class"
ElseIf Incometxt >= 125773 And Incometxt <= 2096200 Then
    StatusLbl = "Upper-income class"
Else
    StatusLbl = "Rich"
End If