Select Case

  • Thread starter Thread starter Jim Richards
  • Start date Start date
J

Jim Richards

I have a Combo1 with 254 items in it. I need to divide it into 2 case
statements:

Case 0 thru 246

and

Case 247 thru 253

Mastering Visual Basic .Net, Page 139, very bottom of the page states:
Same case statements can be followed by multiple values, which are
separated by commas.

Surely there is a shortcut way of expressing the 247 values in Case 0
above.
How do I show the case values without listing all 247 of them?

Thanks in advance, Jim.
 
Jim Richards said:
I have a Combo1 with 254 items in it. I need to divide it into 2 case
statements:

Case 0 thru 246

and

Case 247 thru 253

Mastering Visual Basic .Net, Page 139, very bottom of the page states:
Same case statements can be followed by multiple values, which are
separated by commas.

Surely there is a shortcut way of expressing the 247 values in Case 0
above.
How do I show the case values without listing all 247 of them?

Thanks in advance, Jim.

Case 0 to 246 and case 247 to 253
http://msdn2.microsoft.com/en-us/library/cy37t14y(VS.71).aspx

Hope this helps
LS
 
Why not do smoething like this

intValue = FunctionCall( parms )

Select Case intResult

Case Is >= 75 AND Case Is <90
'bla
Case Is < 65
'bla
Case Else
'bla
End Select


Can you psuedocode something that your looking for?

Miro
 
Jim Richards said:
I have a Combo1 with 254 items in it. I need to divide it into 2 case
statements:

Case 0 thru 246

and

Case 247 thru 253

Mastering Visual Basic .Net, Page 139, very bottom of the page states:
Same case statements can be followed by multiple values, which are
separated by commas.

Surely there is a shortcut way of expressing the 247 values in Case 0
above.
How do I show the case values without listing all 247 of them?

Thanks in advance, Jim.
Please highlight the 'Select' statement and press F1.
 
Case 0 to 246 and case 247 to 253http://msdn2.microsoft.com/en-us/library/cy37t14y(VS.71).aspx

Hope this helps
LS

Thought you could do greater than less than in case statements too.
Case Is < 247 ?
 
Jim Richards schreef:
I have a Combo1 with 254 items in it. I need to divide it into 2 case
statements:

Case 0 thru 246

and

Case 247 thru 253

Mastering Visual Basic .Net, Page 139, very bottom of the page states:
Same case statements can be followed by multiple values, which are
separated by commas.

Surely there is a shortcut way of expressing the 247 values in Case 0
above.
How do I show the case values without listing all 247 of them?

Thanks in advance, Jim.

In this case I would just use an if.
 
Back
Top