10-21-2019 12:56 AM
Hello,
I want to reset an Array. Numeric 1D.
It's getting written on in my Sequence and when the sequence is ended I want to reset it as an empty Array. I want to do this through a statement. Can someone please send me the propper Expression I Need to use to make it empty again?
Solved! Go to Solution.
10-21-2019 02:01 AM - edited 10-21-2019 02:02 AM
Hello Riesengross,
You can just set the number of elements in the array to 0, with this kind of statement:
Locals.MyArray.SetNumElements(0, 0x0)
Make sure your sequence is handling properly the empty array you've just reset.
Regards,
10-21-2019 02:46 AM
Thanks, that worked.
Another easy way is, as I found out,
simply to write:
Locals.MyArray = {}
Simple assign Nothing like in SCALA.
08-19-2022 07:36 AM
Funny. "{}" seems to be interpreted as an "Array of Numbers(64-bit Floating Point)". Whenever you try to reset an array of a different type than that, it won't work. At least not in my Value expression that I'm trying to pass as a Parameter into a subsequence.
Static typing for the win!
So tell me NI, what's the literal for "empty array of containers"?