realbasic-nug
[Top] [All Lists]

Re: Files I don't want to see!

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Files I don't want to see!
From: Kevin Ballard <kevin at sb dot org>
Date: Sun, 30 Dec 2001 14:44:23 -0500
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/



<Prev in Thread] Current Thread [Next in Thread>