[DUG] for..loop

Ross Levis ross at stationplaylist.com
Tue Aug 7 15:38:38 NZST 2007


I use Break if something is found, otherwise let it run to the end.  It's
very convenient to test i > maxvalue at the end to know if a break occurred
or not.

So as long as I don't play with compiler switches or upgrade my version of
Delphi, I should be ok?

Ross.

-----Original Message-----
From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz] On
Behalf Of Steve Peacocke
Sent: Tuesday, 7 August 2007 15:32
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] for..loop

Break?


Steve
-- 
Steve Peacocke
http://stevepeacocke.blogspot.com/

On 07/08/07, Ross Levis <ross at stationplaylist.com> wrote:
> Why does the Delphi help say that a For loop variable has an undefined
value
> after the loop finishes it's iterations?  Surely the variable is always 1
> greater than the maximum "To" value.  That is what appears to happen in
all
> situations I've tested.  I often use this test after a For loop to tell if
> something was not found.  What would cause a different result than this?
>
> Cheers,
> Ross.



More information about the Delphi mailing list