>>Well, if it's a pet peeve, I can assure you that you're not alone. < Puts on fire suit against the upcoming flames > One thing that I think Foxheads don't handle as well as programmers in some other languages, or at least it used to be so, is the handling of Boolean values. My biggest peeve is the something like the following:
DO WHILE .T.
>> * Bunch of code here
>> * Leading to...
>> IF llcondition
>> EXIT
>> ENDIF
>>ENDDO
rather than
>>llcondition = .F.
>>DO WHILE NOT llcondition
>> * Bunch of code here
>> * Including a statement like
>> llcondition = < Logical Expression >
>>ENDDO
Of course, this is just IMO, so I could be wrong.:-)
>
>I agree entirely. I consider EXIT and LOOP to be bugs until proven otherwise :-) Almost without exception, it's an indication that the coder hasn't thought the logic through clearly, making the entire structure suspect.
>
>Personally, I also consider an IF statement without an ELSE in the same class.
Hi Al,
What can you do in this situation:
on escape ovalid.DoExit()
do while oValid.lContinue
for i=1 to lnEnd
......
for i=1 to lnEnd2
...
scan
endscan
next
next
enddo
I had to put exit in each loop in if endif...
If it's not broken, fix it until it is.
My Blog