Syntax for referring to variable name by string?
If I have member called: this.m_yodasShoeSize
and I want to refer to it by a string with something like:
this."m_" + "yodasShoeSize"
is there syntax in c# for that. I expected something like:
this["m_" + "yodasShoeSize"]
or
this[eval("m_" + "yodasShoeSize");
Also, is there a name for what I'm talking about here? I'm not sure what to call this feature, although I have seen it available in a few languages.
wadeonthewebPosted Mar 1, 2004, 2:47 PM
sacrespPosted Mar 1, 2004, 6:45 AM
wadeonthewebPosted Feb 29, 2004, 10:30 PM
string theMemberName = "yodasShoeSize"; Type type this.GetType(); type.GetMember(theMemberName);what is the syntax for storing the result of type.GetMember(theMemberName); or is there no way to do this and I just need to get the member over and over again as I refer to it with type.GetMember(theMemberName); Thanks for any help