You can't use 'To' in a Case statement, you would have to state each value separated by a ",":
B4X:
Select MMI
Case 0.0, 0.1,0.2,0.3 'etc
dist_txt="I. Instrumental - Generally not felt by people unless in favorable conditions"
End Select
It would be easier using If statements for this example.
B4X:
If MMI >= 0.00 Then
If MMI <= 2.0 Then
dist_txt="I. Instrumental - Generally not felt by people unless in favorable conditions"
Else
If MMI <= 2.9 Then
dist_txt=........
Else
If MMI <= 3.9 Then
'etc
End if
End If
End if
End if
Thanks stevel05.
I have been using 'to' in select case statements in VB etc. so I thought it will work. I will go by 'If Else' since 'Case 0.0,1.0,2.0' throws up missing parameter error (I have to see if it is unrelated to Case statement)
Dim Var As Int
Var = 1
Select True
Case (Var >= 0 AND Var <= 2)
Msgbox("Between zero and 2", "")
Case (Var >= 2 AND Var <= 4)
Msgbox("Between 2 and 4", "")
End Select
Dim Var As Int
Var = 1
Select True
Case (Var >= 0 AND Var <= 2)
Msgbox("Between zero and 2", "")
Case (Var >= 2 AND Var <= 4)
Msgbox("Between 2 and 4", "")
End Select