You can't macro expand in C# like you do in VFP.
In this case, it's preferred to use an enum rather than pass a string.
enum ParameterDirection {Input, InputOutput, Output}
Then you can do
param.Direction = ParameterDirection.Input;
>Hi,
>
>Before I do the IF/ELSE, or SWITCH, I am wondering if I could macro expand in C#. Here is an example. I am passing a value of ParameterDirection as a string (e.g. 'Input', 'InputOutput', 'Output') I need to set ParameterDirection based on the passed value.
>
>Here is the pseudo code:
>
>
>string cDirection = 'Input';
>param.Direction = ParameterDirection. + 'cDirection';
>
>
>I am pretty sure that the above syntax will not work. But is there way to make it work? TIA.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer