Variable Lookup in Memory, C#

  • Thread starter Thread starter Pratik Parikh
  • Start date Start date
P

Pratik Parikh

Hi Everyone,

I have a question can you do memory variable lookup in C#, for example
I have a local variable in function declared. I want to lookup the
value of the variable using it physical name... Please let me know.. I
know the question sound like "WHY do you want to do that?". But it is
really important for me to find out, I remember reading it somewhere
that you can do that, but am not able to find it out back... So please
let me know if anyone from you know how to do that.

Thank You,
Pratik Parikh
 
Hi Everyone,

I have a question can you do memory variable lookup in C#, for example
I have a local variable in function declared. I want to lookup the
value of the variable using it physical name... Please let me know.. I
know the question sound like "WHY do you want to do that?". But it is
really important for me to find out, I remember reading it somewhere
that you can do that, but am not able to find it out back... So please
let me know if anyone from you know how to do that.

Thank You,
Pratik Parikh

are you trying to get the value of a parameter in that method or a
varialbe?
the first one can be achieved via
System.Reflection.MethodBase.GetCurrentMethod() (or something like that)
 
Hi Roy,

I am trying to get the value of variable in function. Let me tell
you what i am intending to do. for example.

void test(void){
int test1 = 10;
int test2 =100;

// business logic asserstion
string hello = "((test1+test2)/test2)"

//I need a function that can conver the string to
// some thing like these : ((10+100)/10)
// I wrote a function that deliminates the String by
// variable name, in these case test1
// and add it back after retriving the value of variable
// from memory look up table.

// Problem don't know how to look up the variable value in
// memory lookup table

}

Please Help,
Pratik
 
Back
Top