On 12/30/01 2:35 PM, "Charles Yeomans" <yeomans at desuetude dot com> wrote:
> Of course, we could dispense with all three control structures and just
> use If..Then and GOTO. The point of having the various loop control
> structures is to make it easier to write correct code. The experience
> of many developers over time is that using For...Next with endpoints
> that change during the loop is prone to error.
Of course, my original example was parsing an array. In that instance you
really do want a For...Next loop, even if the bounds change during the loop,
because you are iterating through the array and grabbing values. The only
time you might want a While...Wend loop is if you are deleting values from
the beginning of the array, but so far I haven't had a reason to loop
through an array, destroying it from the ground up.
--
Kevin Ballard
kevin at sb dot org
http://kevin.sb.org/
|