Add element to associate array with custom key from variable: x {$key=$val};
Posted: Tue Oct 25, 2016 9:19 am
Hello! How i can set associate array element with key from variable?
Work code:
output ok:
i want setup key in runtime :local x {$key=$val};
It's not work -> result logical expresion
output:
Work code:
Code: Select all
{
:local key "key";
:local val "value";
:local x {key=$val};
:put $x;
:put ($x->$key);
:foreach k,v in=$x do={:put ("$k=$v")}
}
Code: Select all
key=value
value
key=value
It's not work -> result logical expresion
output:
Code: Select all
false
0=false