Case ranges

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Case ranges

Post by netmaestro »

Example:

Code: Select all

Select a
  case 1-5, 7-13
  case 10,15,20
Endselect
Last edited by netmaestro on Tue Feb 21, 2006 11:01 pm, edited 2 times in total.
BERESHEIT
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

I think something like that is added in 4.0, if i remember well.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Where can I find info on that? I've seen nothing of what's in v4.
Last edited by netmaestro on Tue Feb 21, 2006 11:02 pm, edited 2 times in total.
BERESHEIT
localmotion34
Enthusiast
Enthusiast
Posts: 665
Joined: Fri Sep 12, 2003 10:40 pm
Location: Tallahassee, Florida

Post by localmotion34 »

i think you can do that with the "|" character in the code

like :

Case #WM_DRAWITEM
*DrawItem.DRAWITEMSTRUCT = lParam
Select *lpdis\itemState
Case #ODS_SELECTED

Case #ODS_SELECTED | #ODS_FOCUS
endselect
endselect

Code: Select all

!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

netmaestro, if you scourge the boards, you may dig up some references to what pb v4 can do and not

also, the dev team is known to drop some lines now and again in the chat channel as well

i seem to vaguely recall this was included, i'm pretty sure it was on MY wishlist though :-)
( 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... )
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Yes, Netmaestro, I've seen here in the forums that Fred or other person said it will be in 4.0. I don't know where i saw it, sorry.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
akee
Enthusiast
Enthusiast
Posts: 496
Joined: Wed Aug 18, 2004 9:52 am
Location: Penang, Malaysia

Post by akee »

Right now... all I'm waiting for is PB 4 beta...

Looks like the IDE and Debugger is taking some time...

I bet right now all Fred wants to say is IDE (I've Done Everything)... :p
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

akee wrote:I bet right now all Fred wants to say is IDE (I've Done Everything)... :p
hehe :D
Moreover, who needs the IDE and Debugger? :P
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

akee wrote:I bet right now all Fred wants to say is IDE (I've Done Everything)... :p
:D
@}--`--,-- A rose by any other name ..
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

localmotion34 wrote:i think you can do that with the "|" character in the code

like :

Case #WM_DRAWITEM
*DrawItem.DRAWITEMSTRUCT = lParam
Select *lpdis\itemState
Case #ODS_SELECTED

Case #ODS_SELECTED | #ODS_FOCUS
endselect
endselect
That's not the same.

Code: Select all

Select apple
  Case 3 | 4
    Debug "apple is 7"
EndSelect

Debug 3 | 4
Post Reply