Page 1 of 1

Referencing tags in a textbox

Posted: Tue Jan 07, 2020 1:53 pm
by KevinGi
I'd like to have a textbox display something like:
"Performing operation 5 of 50" where 5 and 50 are tags. How would I do this?

Re: Referencing tags in a textbox

Posted: Wed Jan 08, 2020 2:12 pm
by Russ C.
This can be done in scripting using the value changes of the 5 and 50 tag update a string tag that is assigned to your text object.

For example:

I have current operation number tag named "curOp"
and a maximum operations number named "maxOp"
then I would create a string tag named "stringOp"

and use this function for the value changes of the curOp and maxOp tags

Code: Select all

void operations_ValueChange(System.Object sender, Core.Api.DataSource.ValueChangedEventArgs e)
		{
			stringOp.Value = "Performing operation "+curOp.Value.String+" of "+maxOp.Value.String;
		}
and tie my stringOp tag to the text element on the screen

Then when either tag value changes, the text updates accordingly
dynamic_text_from_tags.png
dynamic_text_from_tags.png (3.98 KiB) Viewed 3935 times