Jan 10, 2012 Replies: 6 Just a small request for the wishlist. It would be nice to be able to use Select Case using the 'greater than' and 'less than' operators <>. It makes for cleaner code than 'if' 'else' and 'end if' etc. Click to expand...
Just a small request for the wishlist. It would be nice to be able to use Select Case using the 'greater than' and 'less than' operators <>. It makes for cleaner code than 'if' 'else' and 'end if' etc.
stevel05 Expert Licensed User Longtime User Jan 10, 2012 #2 Hi Tom, Try formatting it like this: Code: i = 10 Select True Case (i < 9) Log("False") Case (i = 10) Log("True") End Select Steve
Hi Tom, Try formatting it like this: Code: i = 10 Select True Case (i < 9) Log("False") Case (i = 10) Log("True") End Select Steve
T Tom Law Active Member Licensed User Longtime User Jan 10, 2012 #3 Steve that works great - thank you. :icon_clap:
U ukimiku Active Member Licensed User Longtime User Jul 8, 2012 #5 @stevel05: your tip makes code much more readable and elegant. Thanks.
Kintara Member Licensed User Longtime User May 31, 2016 #7 I'll see if it also works for other values. I assume that it will execute the first case that is true and then exit. Code: i = 7 Select True Case (i < 5) Log("<5") Case (i < 8) Log("5 <8") 'this should be executed Case (i < 10) Log("8<10") Case (i = 10) Log("=10") End Select
I'll see if it also works for other values. I assume that it will execute the first case that is true and then exit. Code: i = 7 Select True Case (i < 5) Log("<5") Case (i < 8) Log("5 <8") 'this should be executed Case (i < 10) Log("8<10") Case (i = 10) Log("=10") End Select