Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# switch Gripe
Message
 
 
To
01/01/2009 21:27:04
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Miscellaneous
Thread ID:
01370558
Message ID:
01370612
Views:
26
>>Why in the world must a switch statement need an integer???
>>
>>Other languages are much more flexible in their CASE structures, so why would MS restrict the evaluation of the switch to an int????
>
>See Naomi's answer, but also be aware:
>
>If your trying to compare a switch statement to a VFP "DO CASE", they are very different. To write a VFP style case statement in C# use "else if" .

Very different how? To me they seem quite similar. They are both structured as a series of checks of some value. When a match is found, take some action and exit. Both provide for a default action if no match is found.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform