>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 >So, what is the solution to the problem of removing item from collection while iterating through it if I don't want to start from last item?
for lnI = 1 to Collection.Count oItem[1].Remove() nextwill work