Re: for loops

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"Carsten Bonde" <bonde AT real-inkasso DOT de> wrote in message
news:uiTfLq0GGHA.344@xxxxxxxxxxxxxxxxxxxxxxx
> Beside that, i wouldnt use a FOR ENDFOR-construct, but a WHILE since you
> should exit when the user enters a correct password. Using "EXIT" is in my
> opinion NOT an option <s>

I'm with you in principle but there *are* more lines of code for an
equivalent WHILE and it does execute slower (I guess most likely because
your increment happens in Fox rather than C.) It's unlikely the speed gain
would be beneficial really (in any routine,) I'm just saying... <g>

I've used FOR with EXIT for simple loops, eg checking a string for any alpha
characters present (as soon as you hit one, may as well EXIT.) Although even
that was before I knew how to do it with CHRTRAN.
I've always hated DO WHILE .T. more than FOR..EXIT..NEXT - I guess because
the construct is already waiting for a flag but for all that, why does EXIT
exist? To not be used? <s>

--
Regards
Andrew Howell


.