LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array Delete Row / Column bug or ?..

Solved!
Go to solution

I haven't dug into this deeper but here's what I just saw (it's kinda odd). Say, we have some numeric array of 3 x 3 sizes.

FP 1

Now we start deleting row or column with this menu item: RMB -> Data Operations -> Delete Row (or Column). Keep deleting until the array becomes visually empty. Okay, now run the program. We see something strange - the array has rows (or columns) completely deleted but columns (or rows) are still here!

FP 2

 

Is this an expected behavior of this menu items?

 

I checked this out in LabVIEW 8.0, 2016 and 2017. The result is the same. Here's the VI to play with (LV 8.0).

0 Kudos
Message 1 of 6
(3,886 Views)
Solution
Accepted by topic author dadreamer

Not a bug.  Here is one such discussion on the subject.

 

https://forums.ni.com/t5/LabVIEW/Array-size-of-empty-array-bug/td-p/3340065

 

It has some really small edge cases where you might do something like index into two for loops and want it to run 3 times once for each row, and then the inner loop run 0 times for each column.

Message 2 of 6
(3,872 Views)

Really strange! I have no idea. But I will keep in mind, that I must use the "Empty array" from the right click menu, this one really deletes all contents. I mean makes the size of the array zero in both directions. Since there is no element...

 

I think this is a bug, try it, if you select 3 times the Delete Row, and 3 times the delete Column, only then, the array gets empty!

 

EDit: I replied before reading Hooovah's post. thanks for the clarification, I will keep this info in my mind!

0 Kudos
Message 3 of 6
(3,865 Views)

Hooovahh

I should have known that there is the topic (and not only one) on this subject! Thank you for pointing me out. Cat Wink Well, it's surprising to me that I have encountered this "not-a-bug" today only, when I couldn't understand why my For Loop iterates on the "empty" array. So, now I know and will be using "Empty Array" menu item.

 

I think, NI might do some marks for those odd arrays on both FP and BD, so users know they are dealing with some rare case. Or at least this info might be written in the help (context and manuals).

0 Kudos
Message 4 of 6
(3,850 Views)

Maybe adding a visual indicator that an array has one dimension, but not another might be useful.  But honestly the times I've ran into this are pretty slim and usually are in the creation of the array dynamically.  Like I've seen a initialize array where one input is the size of another array for rows, but columns have a hard coded value.  Here the initialized array might be empty in one direction and this will only be known at run time.  For edit time a visual sign that this is the case might be useful.

Message 5 of 6
(3,841 Views)

Adding new size(s) indicator for arrays might be another option here: LabVIEW Idea Exchange - Add Array Size(s) Indicator

0 Kudos
Message 6 of 6
(3,808 Views)