Yes but the syntax is somewhat different:
Code:
loc.test.a1 = 123;
loc.var_name = "a1";
*loc.test|loc.var_name = 321;
The syntax for dynamic variables is:
*prefix|var_name-postfix
So you can also do:
Code:
loc.test.a1.b = 123;
loc.var_name = "a1";
*loc.test|loc.var_name-b = 321;
You can also do it yourself like this:
Code:
loc.test.a1 = 123;
loc.var_name = "a1";
// Create string containing var name
loc.s = "loc.test.";
loc.s += loc.var_name;
*loc.s = 321;