W
What-A-Tool
There are several differences in "switch", and VB's "Select Case"(which is
what I'm used to) that I can't quite figure. Could someone please point out
what is wrong with the following code - in particular the "case" with the
math operators :
char[] chs = words.ToCharArray(); //Create an array which contains all
entered charecters
foreach (char ch in chs) //Loop thru all charecters in array
{
intCurrChar ++; //Count charecters checked
switch(ch)
{
case '-': //negative sign
break;
case '.': //decimal point
break;
case (> = '0', <= '9'): //numeric charecter
break;
default: //any other charecter
return false;
}
}
Thanks - Sean
what I'm used to) that I can't quite figure. Could someone please point out
what is wrong with the following code - in particular the "case" with the
math operators :
char[] chs = words.ToCharArray(); //Create an array which contains all
entered charecters
foreach (char ch in chs) //Loop thru all charecters in array
{
intCurrChar ++; //Count charecters checked
switch(ch)
{
case '-': //negative sign
break;
case '.': //decimal point
break;
case (> = '0', <= '9'): //numeric charecter
break;
default: //any other charecter
return false;
}
}
Thanks - Sean