suzy wrote:
i know that, but what if i want to run the same bit of code for several
values of fish?
"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:OH**************@TK2MSFTNGP09.phx.gbl...
You can do:
switch(fish)
{
case onefish:
case twofish:
case redfish:
DoSomething();
break;
case bluefish:
DoSomethingElse();
break;
}
--
Bob Powell [MVP]
That's what Bob's code does! When fish is onefish, twofish, or
redfish, then DoSomething is called, when it is bluefish then
DoSomethingElse is called.
Maybe this will make it click:
switch (value)
{
case 1:
case 2:
DoSomething();
break;
}
This is what you asked using VB syntax.
Or maybe if you see it written this way:
switch(fish)
{
case onefish: case twofish: case redfish:
DoSomething();
break;
case bluefish:
DoSomethingElse();
break;
}
-glenn-