For loop with increments different of oneI have a script which creates graphs of x (time) with respect to two consecutive columns (x). I pretend that "i" instead of increasing one by one, I do it two by two.
This is part of the script:
For( i = 2, i <= N Items( numericColNames )-1, i++,
When I change the iteration term to i+2 the script it enter in an loop without end
Advanced Statistical ModelingAutomation and ScriptingMass CustomizationRe: For loop with increments different of oneThanks!
Re: For loop with increments different of one++ is a postfix operator that has the effect of incrementing in place.
There is no general purpose postfix operator to increment by an arbitrary value. Instead you'll need to use the assignment operator (=) to assign the result back to your counter:
for(i=1, i<=20, i=i+2,
show(i)
);
in the log you'll get:
/*:
//:*/
for(i=1, i<=20, i=i+2,
show(i)
);
/*:
i = 1;
i = 3;
i = 5;
i = 7;
i = 9;
i = 11;
i = 13;
i = 15;
i = 17;
i = 19;