<div dir="ltr">On Sat, Apr 16, 2016 at 2:28 PM, Jürgen Hestermann <span dir="ltr"><<a href="mailto:juergen.hestermann@gmx.de" target="_blank">juergen.hestermann@gmx.de</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I don't know what you mean.<br>
A For-loop has it's limits anyway.<br>
And when decrementing 'manually' I would stop if INDEX=0.<br>
For 0-based arrays I would stop if INDEX=-1?<br>
What would be different?<br>
For 1-based arrays I would never get an index<0<br>
because it stops at zero.</blockquote><div><br></div><div>The problem is with using "unsigned" as an index (rather than zero- vs one- based arrays)</div><div>Take a while loop as an example, where index can change multiple times.</div><div><br></div><div>Current solution:</div><div>while i>=0 do </div><div>  if cond then dec(i);</div><div>  dec(i);</div><div>end;</div><div><br></div><div>Unsigned index solution </div><div>while i>=0 do<br></div><div>  if cond then if i>0 then dec(i);</div><div>  if i>0 then dec(i);</div><div>end;</div><div><br></div><div>Without these checks, unsigned integer would loop over to $FFFFFFFF and will continue.</div><div><br></div><div>thanks,</div><div>Dmitry</div></div></div></div>