>If in the range, the 'rangepart' then becomes - zero offset from tnStart
>
>The StartPos-EndPos can span more than one 'rangepart'
>
>rangepartLow = int( (StartPos - tnStart)/tnIncrement)
>rangepartHigh = int( (EndPos - tnStart)/tnIncrement)
>
Sorry, something is wrong here. I got 1 and 0 and I used 10000 as starting point and 50000 as increment.
UPDATE. I changed it to
rangepartLow = ceiling( (StartPos - tnStart)/tnIncrement) * m.tnIncrement
rangepartHigh = ceiling( (EndPos - tnStart)/tnIncrement) * m.tnIncrement
If it's not broken, fix it until it is.
My Blog