>Naomi,
>
>>Hmm, I'm not sure, this needs to be comfirmed. I thought "for each" should work even when adding or removing. I need to review my own FAQ again, I already switched to George's solution but it didn't help yet.
>
>I wrote this example while playing and fighting, so I am risking my Command Ship, meaning that my example might not be quite right, but take a look at this
>
>
>loMyCollection = CREATEOBJECT('Collection')
>WITH loMyCollection as Collection
> .Add('A', 'A')
> .Add('B', 'B')
> .Add('C', 'C')
> .Add('D', 'D')
> .Add('E', 'E')
>ENDWITH
>
>
>FOR EACH lcLetter IN loMyCollection
> ? 'Current letter: ', lcLetter
> IF lcLetter = 'C'
> ? 'Removing ' + lcLetter
> loMyCollection.Remove('C')
> ENDIF
>ENDFOR
>
Interesting, thanks a lot.
If it's not broken, fix it until it is.
My Blog