Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro substitution in c#
Message
From
12/07/2016 19:36:37
 
 
To
12/07/2016 17:42:17
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01638288
Message ID:
01638292
Views:
517
>Is there are way you can execute a marco-substitution in c#, like you can in VFP?
>In VFP it's something like this:
>
>use sometable
>lcCmd = "BROWSE"
>&lcCmd
>
>
>Is there a way you can do something like it in c#?
>
>Thanks.

Sandy, in some instances, you "can", though it's more complicated and the learning curve is considerable. Here are two items to consider:

First. .NET has what's called reflection.

I wrote an article for CODE magazine years ago on moving from VFP to .NET. And even though some of the information is a bit dated, tip #3 in the article will give you some exposure to reflection (and even though Bonnie Berent doesn't come up to this site much, she was very helpful when I was trying to learn reflection over a decade ago)

http://www.codemag.com/Article/0703092

Second, .NET has what's called generics. Generics can help in certain instances where you might think you need macro-substitution/expansion. Sometimes you might have multiple blocks of code that differ only by the type/data type. Generics can help. Again, my CODE article

Again, there's no simple solution and it will require some studying. But in the end it can be worth it.

Update: I see Al gave a suggestion on compiler construction that might also help.
Previous
Reply
Map
View

Click here to load this message in the networking platform