(from the beginners forum)
currently, every case can only have 1 expression
select a
case 1
case 2
case 3
endselect
is it possible to get more expressions per case?
select a
case 1 , 2
case 3
endselect
it beats a long list of if / elseif / elseif / endif...
[Implemented] case select with multiple options
- Psychophanta
- Always Here

- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
- Psychophanta
- Always Here

- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Re: case select with multiple options
> is it possible to get more expressions per case?
> it beats a long list of if / elseif / elseif / endif...
Actually, If/ElseIf uses less code than Case:

> it beats a long list of if / elseif / elseif / endif...
Actually, If/ElseIf uses less code than Case:
Code: Select all
Select a
Case 1,2 If a=1 Or a=2
Debug "1 or 2" Debug "1 or 2"
Case 3 ElseIf a=3
Debug "3" Debug "3"
Case 4 To 10 ElseIf a>3 And a<11
Debug "4 to 10" Debug "4 to 10"
EndSelect EndIf
Case = 113 bytes. If/EndIf = 103 bytes.
it was the best insult i could come up with 
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )

