LabVIEW Idea Exchange

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

Error passed out of FOR loop should NOT auto-index

Status: Declined

Any idea that has received less than 4 kudos within 4 years after posting will be automatically declined.

I often pass an error wire out of a for loop. It auto-indexes, as most outputs of a for loop do, but I never retain the auto-indexing.

 

The current default behavior is:

 

 

 

But I think the default behavior specifically for an error wire should be:

 

 

6 Comments
Darin.K
Trusted Enthusiast

I'd actually hope that the default behavior would be a shift register (pass errors in zero iteration loops), but I really do not see that becoming an automatic operation.  Automatically changing to/from autoindexing makes no difference when replacing with a shift register.

JÞB
Knight of NI

OK Darin already said it! Kudos Darin (Please ignore this post)


"Should be" isn't "Is" -Jay
YavannaKementári
Member

I want to chime in and agree with Darin.K on the use of shift registers for error clusters. For me, almost all of my for loops have errors as shift registers (there are a few cases where it doesn't make sense).

 

The reason I wanted to post something is that I wanted to mention why I think this technique is important. I find it important to know where the first error of something occurred, and with a shift register in the loop, it tends to keep that error (since a majority of code doesn't execute if an error in has an error on the line). Also, if I'm having an error halfway through a many-iteration for loop, usually I would prefer if the loop gave up and moved on, which the shift register does (again since most code won't run with an error on input).

 

Honestly, the least used way of wiring error lines in a loop for me is the auto-index. Yes, it might be useful at times, but 

Brandyn
Member

I concur Valdis

Certified LabVIEW Architect
Certified Professional Instructor
NJKirchner
Active Participant

https://decibel.ni.com/content/groups/labview-apis/blog/2013/04/01/for-loop-pass-through-utility

 

This might help a little, although not everything you've dreamed of

Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 4 kudos within 4 years after posting will be automatically declined.