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

Jussi Lahtinen jussi.lahtinen at ...626...
Thu Dec 18 00:21:57 CET 2008


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




More information about the User mailing list