Page 1 of 1

CaseIf

Posted: Thu Sep 09, 2004 3:22 pm
by naw
Hi,
This would be nice:

Select X
*** caseif (X>100 and X<200): Debug "somewhere between 100 - 200" ***
case 150: Debug "150"
default: Debug "way off"
endSelect

- Oh Yes, and STDIN / STDERR support for PB4 would be fantastic :-)

Ta - N

Posted: Thu Sep 09, 2004 4:24 pm
by GreenGiant
Can't you use If and Elseif for pretty much anything you use select and case for. That would allow more complex statements. It seems to do roughly the same thing to me. I wonder if it gets converted to the same ASM, I'll have top check later.

Posted: Fri Sep 10, 2004 1:59 pm
by naw
Yes of course, I just like to use Case Statements when I have long lists of statements -

long lists of if...then...else...elseif gets a bit messy & hard to follow (IMO)

Posted: Fri Sep 10, 2004 2:56 pm
by Dare2
If speed is important, do a time test on Select/Case -v- If/ElseIf.

I think you'll find If/ElseIf is faster.