07-10-2017 12:59 PM
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.
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!
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).
Solved! Go to Solution.
07-10-2017 01:14 PM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-10-2017 01:18 PM - edited 07-10-2017 01:23 PM
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!
07-10-2017 01:39 PM
Hooovahh
I should have known that there is the topic (and not only one) on this subject! Thank you for pointing me out. 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).
07-10-2017 01:48 PM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-11-2017 01:04 AM
Adding new size(s) indicator for arrays might be another option here: LabVIEW Idea Exchange - Add Array Size(s) Indicator