Results 1 to 31 of 31

Thread: [RESOLVED] Private lines As New List(Of Line)

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2007
    Posts
    448

    Resolved [RESOLVED] Private lines As New List(Of Line)

    vb.net is SOOOOOOO annoying.

    I am drawing a list of lines to a control. So, I declare:
    Code:
      Private Lines As New List(Of Line)
      Private CopyOfLines as New List(Of Line)
    In code, I have a custom Class called "Line".

    I am wanting to reuse the list called "Lines" so I can start a new list while retaining the old list. So I copy it's contents to "CopyOfLines", then clear the contents of "Lines":

    Code:
    CopyOfLines = Lines
    Lines.Clear
    Problem is the contents of CopyOfLines ALSO gets cleared! Is there no way to break the connection of "CopyOfLines" to "Lines"? This seems so unnecessary. After all, if I say:
    Code:
    a=10
    b=a
    a=0
    Then (b) will still = 10 while (a) = 0.

    Why does vb.NET have to break such simple logic and turn it into a gargantuan issue? I wouldn't mind it as much if the MSDN library would make it possible to find references to "List (Of whatever)", but all I get are references to text in a textbox. It seems that every time I go to the MSDN, I get a convoluted, runaround explanation or simply no documentation of something someone has done in their own code? Where did THEY find the information?

    (Now I know why only 19% of vb6 users went to vb.NET.)
    Last edited by treddie; Apr 19th, 2009 at 06:18 PM.

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