[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
RE: programming question
- Subject: RE: programming question
- From: Patricia M Godfrey pmgodfrey@xxxxxxxx
- Date: Tue, 9 Nov 2004 10:13:58 -0500
Carl wrote: >> a conditional test to prevent the counter from
incrementing ad infinitum<<
There's a universal programming principle here, with an interesting
corollary. If you're counting, you often don't know what the final count
is going to be, so you need a condition _other than the value of the
counter_ to terminate the loop. That's why in dBase (before the
introduction of the scan...endscan command) you almost always had to add
.AND. .NOT. eof() (meaning 'and the end of the dataset has not been
reached') to any DO...WHILE loop. Otherwise, if the other condition was
true of the last record, you code would keep performing its operations on
that last record until doomsday.
Patricia M. Godfrey
PMGodfrey@xxxxxxxx