Reflection/List properties: Difference between revisions

Content added Content deleted
m (syntax highlighting fixup automation)
imported>Arakov
Line 98: Line 98:


=={{header|Elena}}==
=={{header|Elena}}==
ELENA 5.0 :
ELENA 6.x :
<syntaxhighlight lang="elena">import system'routines;
<syntaxhighlight lang="elena">import system'routines;
import system'dynamic;
import system'dynamic;
Line 105: Line 105:
class MyClass
class MyClass
{
{
prop int X;
int X : prop;
prop string Y;
string Y : prop;
}
}

public program()
public program()
{
{
Line 117: Line 117:
this Y := "String";
this Y := "String";
};
};

MyClass.__getProperties().forEach:(p)
MyClass.__getProperties().forEach:(p)
{
{
console.printLine("o.",p,"=",cast MessageName(p).getPropertyValue(o))
console.printLine("o.",p,"=",p.getPropertyValue(o))
}
}
}</syntaxhighlight>
}</syntaxhighlight>