09-22-2010 12:57 PM
Does the function Reinit To Default set a 2D Array size to zero? The Help is not explicit on this.
If not, what is the best way to set a 2D Array size to zero?
Solved! Go to Solution.
09-22-2010 01:16 PM
Yes, it sets the size of an array to zero elements, unless the default value is defined otherwise (right click, make current value default.).
There are several ways to empty an array indicator/control.Normally I write it's value to the terminal or to a local variable. I have never used 'Reinit values to default'
Ton
09-22-2010 01:18 PM
From the "it takes less time to just try it than to post a message asking if it does it": the answer is yes. But only if the default value is an empty array to begin with. Obviously.
If not, what is the best way to set a 2D Array size to zero?
Wire an empty array constant to your choice of a local variable or a "Value" property node, taking into account the elimination of any potential race conditions.
09-22-2010 02:13 PM - edited 09-22-2010 02:15 PM
I was using Reinit To Default on a 2D Array of Strings and it looked like it was not setting the size to zero.
I'll try writing the 2D Array Constant to the Value instead.
09-24-2010 04:16 AM
@dbaechtel wrote:
I was using Reinit To Default on a 2D Array of Strings and it looked like it was not setting the size to zero.
I would be very interested in such a code (unless you can confirm that the default value was changed).
Ton