BlitzMax Request: expression ranges.

BlitzMax Forums/BlitzMax Programming/BlitzMax Request: expression ranges.

JoJo(Posted 2005) [#1]
Would it be to much trouble to implement something like this using the Select block?

Select MouseX()
   Case 100 To 200
   Case 201 To 300
   Case 301 to 400
End Select


I think this would be good so you won't have to use if/else stmts.


EOF(Posted 2005) [#2]
Heres a way ...

m=MouseX()
Select True
 Case (m>=1 And m<=4)
 Case m=5,m=6,m=7
 Case m=8,(m=9 Or m=10)
End Select
Print
Next



N(Posted 2005) [#3]
Personally, I don't think this should be included.

Local MX:Int = MouseX()
If MX > 100 And MX < 200 Then
ElseIf MX > 200 And MX < 300 Then
ElseIf MX > 300 And MX < 400 Then
EndIf


While I do thing that the ranges make code look better, I don't think they're really neccessary.


FlameDuck(Posted 2005) [#4]
Yeah. Use "Select True".


JoJo(Posted 2005) [#5]
Very well. Thanks jb!