Results 1 to 2 of 2

Thread: ArrayList problem

Threaded View

  1. #1

    Thread Starter
    Member leazfe's Avatar
    Join Date
    Mar 2004
    Location
    Spain
    Posts
    43

    ArrayList problem

    I have used an arrayList in order to avoid te capacity problems. But, i am getting the next error when i try to iterate over all elements:
    An unhandled exception of type 'System.InvalidOperationException' occurred in mscorlib.dll
    Additional information: Collection was modified; enumeration operation may not execute.
    The code is:
    Code:
    For Each tmpTree In ar
        If tmpTree.IsLeaf Then
           ar.Remove(tmpTree)
        End If
    Next
    The Message is enought clear, but really am I not able to modifie the arraylist?

    Thanks,
    Álvaro
    Last edited by leazfe; Apr 26th, 2004 at 09:34 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width