01-06-2020 03:46 AM
Hi All
I have a container which has certain numeric and string elements.
I want to assign values to all these numeric and string elements at once through one step.
Something similar to array.
For eg: if I have numeric array A1 defined in TS , I can assign multiple elements to it by syntax:
A1 = {1,2,3,4,5}
Is there a similar syntax/way to assign to values to all elements of containers at once?
Thanks in advance
01-06-2020 10:36 AM
Unfortunately this doesn't exist.
The problem is with containers you can have different types and depths of hierarchy. How would you depict the different levels of hierarchy in a single command like that?
You can assign all elements in a single statement by separating with a comma.
Example:
Locals.Foo.MyString = "Hello",
Locals.Foo.MyNumber = 5,
Locals.Foo.MyBoolean = True,
Etc...
01-07-2020 12:29 AM
Thanks for the reply.
Yup the option which you suggested is what I have currently implemented.
But i was just wondering if I am missing out on something..
In some cases , containers can have same datatype(but still it wont be an array since you need to access individual elements also later seperated based on names etc.) and thought this could be useful in that case.