Re: for loop (c-lang)
- From: erewhon@xxxxxxxxxx (J French)
- Date: Wed, 28 Feb 2007 14:26:31 GMT
On Wed, 28 Feb 2007 12:43:12 +0000, Dodgy
<Dodgy@xxxxxxxxxxxxxxxxxxxxx> wrote:
<snip>
Well it might be in Delphi, not sure, can honestly say if I've ever
tried to do a loop zero times in a for, but from the programming
background I come from "for" and "repeat" loops have the comparison at
the end, a "while" has it at the beginning.
I guess I'll have to blow the dust of my asm programming and see what
Delphi pumps out.
Steve, I hope your ants are still marching :-}
For N := 2 To 1 Do
will not execute the loop, although in early versions of BASIC I have
heard that it did. I can't remember.
The real thing is that 'C' has its own rules and being supremely
illegible the OP that managed to post in a totally inappropriate group
failed to see that the expression in Delphi evaluates to :
For N := 0 To 0 Do
And it is pretty obvious that it will do its thing once.
.
- Follow-Ups:
- Re: for loop (c-lang)
- From: Dodgy
- Re: for loop (c-lang)
- From: Rob Kennedy
- Re: for loop (c-lang)
- References:
- for loop (c-lang)
- From: mohdalibaig
- Re: for loop (c-lang)
- From: Dodgy
- Re: for loop (c-lang)
- From: Maarten Wiltink
- Re: for loop (c-lang)
- From: Dodgy
- for loop (c-lang)
- Prev by Date: Re: SetString
- Next by Date: Re: SetString
- Previous by thread: Re: for loop (c-lang)
- Next by thread: Re: for loop (c-lang)
- Index(es):