10-16-2022, 09:23 PM
(10-16-2022, 09:12 PM)Pete Wrote: Two votes for cool, 1 vote yuck. Cool wins. When can we expect the roll out???
Pete
I dunno. How quick can you push a pull request with the changes you've implemented for this into the repo, so we can reject them?
I imagine the roll out would probably be two days after never, after that!
Kidding aside, I honestly don't think any developer would waste their time ever typing to adopt such a syntax into the language. All we do with SELECT CASE is translate the SELECT CASES into IF.. THEN.. code already. For example here's a simple SELECT CASE and it's translated code:
Code: (Select All)
Select Case x
Case Is < 0
Case Is = 0
Case Is > 0
End Select
Code: (Select All)
if (((*__SINGLE_X<((float)( 0 ))))||new_error){
sc_ec_1_end:;
goto sc_1_end;
}
if (((*__SINGLE_X==((float)( 0 ))))||new_error){
sc_ec_2_end:;
goto sc_1_end;
}
if (((*__SINGLE_X>((float)( 0 ))))||new_error){
sc_ec_3_end:;
goto sc_1_end;
}
sc_1_end:;
Our SELECT CASE basic code gets translated into IF-THEN c code, when all is said and done. As I mentioned above, if one *really* likes such a syntax as you showcased, why not just use IF-THEN directly and skip that step of QB64 having to translate from SELECT CASE to IF for you.