Macro Substitution

  • Thread starter Thread starter Rodolfo
  • Start date Start date
R

Rodolfo

Hello, there's another languages that can do a macro substitution, how can I
do this in Csharp.

This is an example of what I want to do

Dataset ds = new Dataset;

string a = "ds";

DataSet ds2 = &a;

This is a little more complex

int i = 6;
int j = 5;

string a = " i == j";

bool b = &a; //b will be false

TIA
 
You cannot. Macro substitution like that is mostly a feature of
interpreted languages (such as dBase), and implementing it in compiled
langauge (such as C#) is usually a nightmare, so most avoid it.

It basically requires the program to recompile itself on the fly; or switch
into interpreted mode. Which would require the program to drag along with
it, either a compiler or interpreter
 
Back
Top