Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FoxPro Style Macro Substitution in C#
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01566711
Message ID:
01566742
Views:
201
>Is there anyway to do FoxPro Style Macro Substitution in C#?
>
>For example in FoxPro you can do something like this:
>
>
>lcFieldName = "Address"
>SELECT name, &lcFieldName, city, state, zip FROM customers INTO CURSOR x
>
>
>The &lcFieldName above does a macro substitution putting "Address" into the SQL statement. Is there something similar in C#?

As Naomi points out you can, in this case, simply build up the string.
But the short answer is No - there is no simple equivalent in C# (because it is a compiled language).
It is possible to dynamically compile C# at runtime (see System.CodeDom and Microsoft.CSharp.CSharpCodeProvider namespaces) -
but it fairly laborious although infinitely flexible.
Previous
Reply
Map
View

Click here to load this message in the networking platform