Question re. for loop structure

 
Hi is the following for loop allowed?
If not, do i skip inside the loop in that case?

for (int i=limit; i>=0; i=i-barsPerDay) {
...
}

tia,

Fermin DCG
 
there is legal construction. what the problem?
 
there is legal construction. what the problem?


That's what i thought.
The reason for asking was that the cpu went to 100% and all was not fine.

I'll retry and see whether the error persists and 'report back'

thx
 
dacosta
I guess the only reason for your cpu going to 100% is that barsPerDay is less than zero,
in that case, the loop take forever to exit.
Check that.

Matias
 
dacosta
I guess the only reason for your cpu going to 100% is that barsPerDay is less than zero,
in that case, the loop take forever to exit.
Check that.

Matias

Obviously it was my misstake ;-) and indeed it had to do with going below zero.
In an attempt to hack around it i build in a decrement statement at the end that i forgot to remove (and did not not check for 0).

Thx 4 your input

Fermin DCG