Re: [Gambas-user] Better way to delete element from array when enumerating

2008-12-21 Thread Benoit Minisini
On jeudi 18 décembre 2008, Jussi Lahtinen wrote: > Hi! > > I have code like this: > > Dim element as ClassX > > FOR EACH element IN objectarray > IF element = something THEN > objectarray.Remove(objectarray.Find(element)) > ENDIF > NEXT > > This works, but I'm almost sure that there is better way t

[Gambas-user] Better way to delete element from array when enumerating

2008-12-17 Thread Jussi Lahtinen
Hi! I have code like this: Dim element as ClassX FOR EACH element IN objectarray IF element = something THEN objectarray.Remove(objectarray.Find(element)) ENDIF NEXT This works, but I'm almost sure that there is better way to do this. Feel kind of dumb to find same element two times... Jussi