RosettaCodeData/Task/Dynamic-variable-names/Elena/dynamic-variable-names.elena

23 lines
470 B
Plaintext

import system'dynamic;
import extensions;
class TestClass
{
object theVariables;
constructor()
{
theVariables := new DynamicStruct()
}
closure()
{
auto prop := new MessageName(console.write:"Enter the variable name:".readLine());
(prop.setPropertyMessage())(theVariables,42);
console.printLine(prop.Printable,"=",(prop.getPropertyMessage())(theVariables)).readChar()
}
}
public program = new TestClass();