Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FoxPro Style Macro Substitution in C#
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01566711
Message ID:
01566742
Vues:
198
>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform