LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Taylorh140

Index array Improvements

Status: New

There are two things that bother me about the index array. I think these changes would be useful to nearly all LabVIEW users.

 

  1. The default value is not optional (for integers always zero, a very useful value) There should be a way to set the desired value if the index is out of bounds.
     

    Image 1.png

  2. There should be a way to get rather the index is out of bounds from this primitive since this has to be check anyhow to know whether to use the default value.Image 2.png should look something like this: Image 3.png

     

     

The lack of these items usually proves to generate code that looks much uglier than necessary.

Although I do not know the internal workings of this primitive it would be hard for me to believe that this would have much of a performance impact. Also, bound checking arrays is necessary for many algorithms, why do it twice? 

2 Comments
AristosQueue (NI)
NI Employee (retired)

The bounds check output is a duplicate:

https://forums.ni.com/t5/LabVIEW-Idea-Exchange/Index-array-with-index-valid-indicator/idi-p/3268460

That idea was Declined because it only got 3 kudos after 3 years.

 

I find no record of the default value specifier being suggested before. Therefore, I will leave this idea open.

crossrulz
Knight of NI

I managed to find a related as in it is for the Reshape Array.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5