D
Daan
Say I have an Object of the following class:
public class SomeClass {
public string var1;
public int var2;
public SomeType var3;
}
Now I want to print all the three vars. Is it possible to get an array
containing these three vars, making something like this possible:
for (int i = 0; i < myArray.Length; i++) {
myPrintFunction(myArray);
}
Or is there no other option then to print each class variable
explicitly, like this:
myPrintFunction(myObject.var1);
myPrintFunction(myObject.var2);
myPrintFunction(myObject.var3);
My guess would be that the Reflection library makes such a thing
possible, but I could not find it there.
Regards,
Daan
public class SomeClass {
public string var1;
public int var2;
public SomeType var3;
}
Now I want to print all the three vars. Is it possible to get an array
containing these three vars, making something like this possible:
for (int i = 0; i < myArray.Length; i++) {
myPrintFunction(myArray);
}
Or is there no other option then to print each class variable
explicitly, like this:
myPrintFunction(myObject.var1);
myPrintFunction(myObject.var2);
myPrintFunction(myObject.var3);
My guess would be that the Reflection library makes such a thing
possible, but I could not find it there.
Regards,
Daan