LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

build array with empty 2D array

I have found a nice question for CLAD:

What is the size of the output 2D array when concatenating no-empty 2D array with an empty 2D array?

a) the same as original 2D

b) not the same as original 2D

c) none of the above

 

Correct answer (c): it depends on the way the empty 2D array was made. If it was a 1D array sometime ago, then the size will increase, otherwise the size will not change.

 

Building 2D array with an empty 1D array will also add line of zeros.

 

Is it really an expected behaviour?

 

0 Kudos
Message 1 of 5
(3,360 Views)

So I agree with you that this looks like both outs should be the same.  But if you probe around you will see why this is happening (not saying it is right just why).

 

If you put an Array Size in there to see what the size of the "Empty" arrays are you see that in one dimension it is 0 but in another it is 1.  This is kinda like the wind having direction but no speed.  Because of this the build array operation may do different things because the two Empty arrays are equal in data, but not in attributes.

0 Kudos
Message 2 of 5
(3,298 Views)

The thing I do not like most in this issue is that array has hidden parameter that can not be determined by looking at its data. It is hard to find mistake of this kind during debugging (by probing). And it kind of contradicts LabVIEW high level programming: user can not directly control array memory allocation (other than by adding data), but this behaviour makes array properties separate from data.

I will add the idea to include array size into default probe information.

0 Kudos
Message 3 of 5
(3,269 Views)

@Alexander_Sobolev wrote:

 

I will add the idea to include array size into default probe information.


This can be done quite easily with a custom probe and even have options to set a breakpoint if array size in a defined dimension is greater than, less than, or equal to a value.

0 Kudos
Message 4 of 5
(3,262 Views)

@Hooovahh wrote:

@Alexander_Sobolev wrote:

 

I will add the idea to include array size into default probe information.


This can be done quite easily with a custom probe and even have options to set a breakpoint if array size in a defined dimension is greater than, less than, or equal to a value.


Plus, it's already been suggested.

 

I haven't really looked into it but is this the same as this, brought up in the minutiae thread?

--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 5 of 5
(3,254 Views)