|
In my code i want to access a property of an object.
thing is though that i do now know beforehand which property this is going to be.
Right now it's like this:
the_value = c_object.c_property;
But the thing is that here c_property is a variable,
i want to get the property who's name is the same as the content of c_property.
How do i do that?
|
|
|
I got it, the solution is the following:
c_property_value = eval("c_object." + c_property);
|
|
|
|
|
|
|
// |