Le 31 mars 09 à 22:17, Charles Yeomans a écrit:
On Mar 31, 2009, at 3:55 PM, Arnaud Nicolet wrote:
Le 31 mars 09 à 20:41, Christian Dorn a écrit:
No, because of some recent changes in Mac OS 10.5 (or coming
changes in 10.6?) this shouldn't be done, IIRC. I think you'll
find something on this matter in the archives...
Maybe this page is of interest for you:
http://www.declaresub.com/wiki/index.php/Delete_items_from_a_list
After looking at that page, it appears a way isn't listed. So I
wonder if the way I think of is actually bad.
I'd do that way:
dim i as integer
for i=0 to ubound(SomeArray)
if SomeArray(i).HasToBeDeleted then
SomeArray.Delete
i=i-1
end if
next
Well, it's similar to the first case, but still a bit different
(for loop instead of while, and less lines of code).
It's a bad one?
Yes. In fact, code like this is often offered as an example of
bad. The reason is that it sabotages the intent of the for-next
structure.
Hmm... We can argue on whether it's bad or not (it sill functions as
it should).
Thank you
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|