The switch statement can only evaluate 1 expression, unlike the VFP case statement. the exact match to vfp case would be if... else if.. else.. statement block.
HTH.
>Hi Kevin,
>
>You may wish to use the Switch statement.
>
>There is an example and explanation here:
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csspec/html/vclrfcsharpspec_8_7_2.asp>
>The switch statement selects for execution a statement list having an associated switch label that corresponds to the value of the switch expression.
>
>
>switch-statement:
> switch ( expression ) switch-block
>switch-block:
> { switch-sections opt }
>switch-sections:
> switch-section
> switch-sections switch-section
>switch-section:
> switch-labels statement-list
>switch-labels:
> switch-label
> switch-labels switch-label
>switch-label:
> case constant-expression :
> default :
>
>
>
>Hope this helps.
>
>TFISHER
>
>>I am trying to convert some strings based on conditions. In VFP I would do something like:
>>
>>
>>DO CASE
>>CASE condition a
>> && code here
>>CASE condition b
>> && code here
>>OTHERWISE
>> && code here
>>ENDCASE
>>
>>
>>How would this be coded in C#?
>>
>>TIA, Kevin