LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
Nico_EMC

Select the for loop max number of iteration

Status: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined.

Today, a for loop always select the minimum number of iteration between the number wired in "N" input and the size of every auto-indexed array.

It will be great to select between three mode :

- the minimum value, like today, with a "N" terminal.

- a fix value, ie the value send to the terminal, who become a "F" terminal (for example), no mater the size of the auto-indexed array.

- the maximum value, with a "M" terminal for example.

4 Comments
AristosQueue (NI)
NI Employee (retired)

Based on what we see with autoindexing on While Loops, I suspect adding such behavior to a For Loop would cause more G bugs than it solves. R&D has occasionally discussed removing autoindexing inputs from the While Loop* because of this behavior -- people don't test sufficiently and get all sorts of strange behavior when it starts indexing out of range. It would take a lot of customer kudos for us to the spread that often-buggy behavior onto the For Loop.

 

Speaking more personally, I've kept my eyes out for years for times when users have written code that would make the loop run the maximum number of iterations. Your request marks the second time I've heard someone actually want this. The other time I've seen it, the customer had code to pad the shorter array, but they did not pad with default values -- they needed to interpolate values on the shorter array to make it as long as the longer array. So adding this feature wouldn't have helped them. That puts this request in the really rare category.

 

I am going to recommend R&D decline this idea.

 

* We won't remove it from While Loop because it has been in so long (we even kept it in LV NXG), but after the For Loop got its early terminate terminal back in 7.0, the autoindexing on While Loop became more of a liability than a feature.

wiebe@CARYA
Knight of NI

It actually (tries to) solve the same problem as this idea: For-loops-that-can-auto-index-beyond-the-end-of-the-shortest-array*. But in a different way.

 

If I had to choose, I'd prefer the other idea. Seems less confusing...

 

* Duplicate ofNew-modes-on-auto-indexed-input-array-tunnels-in-loops. In turn duplicate of Looping-Input-Tunnels

crossrulz
Knight of NI

AristosQueue wrote: but after the For Loop got its early terminate terminal back in 7.0

 

Slight correction.  It was actually introduced in 8.6.  I abused that feature as soon as it was introduced.  It was great for search algorithms.


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
Darren
Proven Zealot
Status changed to: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined.