From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Idea Exchange

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

Loop Index Wrapping Option

Status: Declined

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

Loop indexes max out at 2,147,483,647.  It would be nice to have an option to wrap around the loop index instead of having it remain constant, in the event that you have a process that depends on that loop index incrementing.

3 Comments
RavensFan
Knight of NI

One complication of this is that many people rely on code where they want to do something on the first iteration of the loop at i=0.  You wrap around and you evenually get back to another i=0.

 

If you really care about a loop iteration value higher than that, perhaps you should set up a shift register and increment it on every iteration and use a U64 datatype.

 

 

SpaceX Trip
Member

Right, but if we made it an option then we can choose wrapping or no wrapping, which means our code that depends on the first iteration being = 0 could still function.  It also wouldn't necessarily have to wrap to 0.  Wrapping as an I32 would on a fb node would be acceptable as well.  Then we go right back to your original point...why don't we just throw in a U64 on a shift register and be done with it....then you have your cake and eat it too. (i=0 works, and you get your loop counter that never fails)

Darren
Proven Zealot
Status changed to: Declined

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