LabVIEW Idea Exchange

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

for loop increment

Hi all,

 

It will be very convenient to have the ability to change the amount increment in a for loop.  Currently, the i in for loop start at 0 and increment by 1 for each iteration.  It will be great if we can change the start point of i and the amount increment, similiar to what we can do in c.

 

for(i=2; i<10; i=i+3)

 

Yik

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
7 Comments
RavensFan
Knight of NI
I would say what you are suggesting has already been proposed here "Start-Step-Stop" structure on For loops.
JackDunaway
Trusted Enthusiast
Check out Raven's link above, and check out my first comment on that link. This idea is a duplicate of a duplicate. But this functionality is so fundamental that I truly believe - in some type of an XKCD existential sort-of a way - that by Kudoing all three Ideas, it will more likely be implemented....
CrystalTech
Member
I like this idea.  There would certainly have to be a redesign of the box to allow 2 integers to show, but Kudos for the idea.
JackDunaway
Trusted Enthusiast

CrystalTech wrote:

There would certainly have to be a redesign of the box to allow 2 integers to show


No, there would have to be three terminals, Begin, End and Increment. And why limit the parameters to integers? Check out asco's original Smart Iterators with Loops.

muks
Proven Zealot
Definetly useful. Kudos!!!
Alexander_Sobolev
Active Participant

In C it is very powerfull because you can use any expression in stop condition and "increment" action, and it can include variables from all other program. I do not think that merging formula node, stop condition and iteration terminal into one item is a good idea.

If you need modified iteration terminal, expression node is very compact. 

 

Darren
Proven Zealot