[Implemented] Multiple Expressions in Case Statement

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
ebs
Enthusiast
Enthusiast
Posts: 558
Joined: Fri Apr 25, 2003 11:08 pm

[Implemented] Multiple Expressions in Case Statement

Post by ebs »

I'm converting some Visual Basic code (to read EXIF information in image files) to PB and I ran into this minor annoyance. In VB, the Case statement (in a Select Case) can have multiple expressions, as in:

Code: Select all

Select Case Var
  Case 1,3,5
          .
          .
  Case 16,20,32
          .
          .
End Select
In PB, I have to repeat whole blocks of code to get the same result. I know I can use multiple If - ElseIf statements in PB, put this would be a handy addition to the PB Select statement, if it isn't too hard to implement.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

that's one that has come up before :-) and yes, i like it too! :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Denis
Enthusiast
Enthusiast
Posts: 778
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Post by Denis »

Yes,

I think it's a good idea. :wink:

Denis
A+
Denis
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2139
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Post by Andre »

Denis wrote:Yes,

I think it's a good idea. :wink:

Denis
And it was already on the wishlist, see here, here and here.

So its up to Fred.... :D

Currently the best choice is to use If, ElseIf, Else, EndIf instead.
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
Post Reply