How to initialize a template (or class) array tag?

Hi,

I’m working on a project which uses a template array tag, and am looking for a method to initialize the entire array which doesn’t involve addressing each array element within a loop.

Can anyone tell me how this can be done?

Regards,
Greg Shearer

Hi Greg,

Have you tried to use this column StartValue?

Let us know if it helps you please.

Best Regards,
Tatsoft Team.

Hi Eduardo.

My apologies, as I should have explained further.
Startup initialization is fine, but I need to re-initialize repeatedly while the application is running.
I was hoping there would be a single function call to initialize the entire array whenever needed.

Hi Greg,

You have 2 methods for that:

OBS: “tagVet” is the array tag name. The codes in this message will be executed through a button.

1 - TK.InitializeTag(“tagVet”);
When executed it will make the values go to 0 for all the tags in the array.

2 - TK.ClearTag(“tagVet”);
When executed it will make the values go to the “StartValue” for all the tags in the array.

If you need something else, let us know.
Best Regards,
Tatsoft Team.

Thanks Eduardo.

Since starting this topic I’ve realised the significance of he Tool Kit (TK) class … so hopefully won’t be asking quite so many basic questions in future :slight_smile:

I should add that some additional documentation showing examples of how to use the TK class members would be really appreciated. For someone new to FactoryStudio/.NET the current documentation doesn’t provide much guidance.

Hi Greg,

That’s good, but don’t hesitate to ask questions if you need something.

For TK class documentation you can access this link:
https://tatsoft.com/help/fs-8.1/index.html#frlrfnamespaces_referenceCustomTopic.html

Best Regards,
Tatsoft Team.