You are looking at many info about incrs

It increaments a variable all the way up (or down) to the designated value, then sets it to the final value like this:
Syntax:
incr {variable} from {start} by {incr} to {stop} then {reset}

incr $counter from 1 by 1 to 5 then 1;

In this example, assuming $counter has not been previously set, it will start at 1, increaste to 2, then 3,4 and finally 5. the next time you try to increment it, it will be reset to 1 and the incrementing can start all over again.

You can happily go backwards:

incr $counter from 9 by -1 to 5 then 9;

This will start our counter at 9 then work its way down to 5 then back up to 9 again.

naturally if you want to only loop through once.. just set your reset number to your ending number like this:

incr $counter from 2 by 2 to 10 then 10;

This jumps up in 2s until it reaches 10 then nomatter how many time you ry and increment it, will remain on 10 (handy if you want something to grow and not revert back to its younger state).


In theory you can use variables in place of numbers so:

$min = 1;
$step = 1;
$max = 5;
$reset = 5;
$counter=3;
incr $counter from $min by $step to $max then $reset;