kriz6912
10 years agoNew Contributor
Accessing object via string reference
Hi,
Currently I access the fields in MyObject in following manner:
var MyObject = Aliases.Device.Process_qv.RootLayout.Layout('NO_ID').ListView('profile_list');
var ButtonLabel = MyObject.Button("title", 1).mText;
I'm wondering if it also possible to store an object reference as a string and create an object of it when needed. This way I can maintain a centralized list of all object references.
var MyObjectRefString = "Aliases.Device.Process_qv.RootLayout.Layout('NO_ID').ListView('profile_list');"
var MyObject = ??? how to turn object string reference into an actual object ???
var ButtonLabel = MyObject.Button("title", 1).mText
Thanks!
Currently I access the fields in MyObject in following manner:
var MyObject = Aliases.Device.Process_qv.RootLayout.Layout('NO_ID').ListView('profile_list');
var ButtonLabel = MyObject.Button("title", 1).mText;
I'm wondering if it also possible to store an object reference as a string and create an object of it when needed. This way I can maintain a centralized list of all object references.
var MyObjectRefString = "Aliases.Device.Process_qv.RootLayout.Layout('NO_ID').ListView('profile_list');"
var MyObject = ??? how to turn object string reference into an actual object ???
var ButtonLabel = MyObject.Button("title", 1).mText
Thanks!
Hi Kriz6912,
You can use the eval function for this:
var MyObjectRefString = eval("Aliases.Device.Process_qv.RootLayout.Layout('NO_ID').ListView('profile_list')");