|
Post by Psycho on Sept 10, 2008 21:13:32 GMT -5
I'd like to see the select case function expanded in upcoming versions to match the functionality in Liberty Basic. Specifically, evaluating statements that do not have a numeric or string expression. Using some examples from the help file to demonstrate, this program runs fine in LB and RB: num = 3
select case num case 3, 5, 10 print "3, 5, 10" case 3, 12, 14, 18 print "3, 12, 14, 18" case else
print "Not evaluated." end select
whereas this one will run in LB but generates an error in RB as the select case function doesn't currently support evaluating conditions without a numeric or string value being defined within the select case statement. value = 58
select case case (value < 10) or (value > 50 and value < 60) print "First case"
case (value > 100) and (value < 200) print "Second case"
case (value = 300) or (value = 400) print "Third case"
case else print "Not evaluated" end select
This is far from being a show stopper but it has forced me to re-do some existing functions that already made use of this feature in LB and had me create multiple if/thens to achieve the same result. Any consideration would be appreciated. John Siejkowski
|
|