ni.com is currently undergoing scheduled maintenance.
Some services may be unavailable at this time. Please contact us for help or try again later.
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?
已解决! 转到解答。
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,
Thanks, that worked.
Another easy way is, as I found out,
simply to write:
Locals.MyArray = {}
Simple assign Nothing like in SCALA.
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"?