[DUG] for..loop
Robert martin
rob at wildsoft.co.nz
Tue Aug 7 15:45:53 NZST 2007
Hi
Like others have said, it could change at any time. If I need to nkow
if something was found there is usually another variable asside from
the counter that can be checked.
I almost always use while loops when searching for items as you can
easily exit them without using 'Break' (which I have an aversion to).
I mainly use for loops for loading all values of a list.
p.s. has anyone else noticed that sometimes when you step through a for
loop the counter actually counts down (in the debugger) (even if it set
to count up). This was the case sometimes in D6 if I recall correctly.
Rob Martin
Software Engineer
phone +64 03 377 0495
fax +64 03 377 0496
web www.chreos.com
Wild Software Ltd
>
> 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.
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
> unsubscribe
>
> Attention:
> This communication is confidential and may be legally privileged. If you are not the intended recipient, please do not use, disclose, copy or distribute it, other than to return it to us with your confirmation that it has been deleted from your system.
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject: unsubscribe
>
>
More information about the Delphi
mailing list