Hello everyone.
I want to read or write to Layout parameter concatenated from text and variable.
I have parameters Lyt.EM1CMD up to Lyt.EM20CMD.
I know it is incorreect but I would like to do something similar to this ("i" is variable):
('Lyt.EM' + i +'CMD') = 1
Is it even possible in DeltaV Live TypeScript?
Yes it is possible!
I took a button and put the below script to read the EM1CMD variable (in my case a string) and updated the Button Label with the value
const i:number = 1; //Set the start valueDsp.Button1.Label = (Lyt as any)['EM' + i + 'CMD']; //Update the button text with EMxCMD value
Then I took another button and put the below script to update layout variable with different text
const i:number = 1; //Set the start value(Lyt as any)['EM'+i+'CMD'] = 'Command ' + (i + 1); //Update the Variable EMxCMD Text
In reply to Matt Stoner:
In reply to Jacek: