VS 2015 How to create a new instance of the same array?-VBForums
Results 1 to 2 of 2

Thread: How to create a new instance of the same array?

  1. #1

    Thread Starter
    Addicted Member NinjaNic's Avatar
    Join Date
    Dec 2013
    Location
    Earth
    Posts
    226

    Question How to create a new instance of the same array?

    Using a 2D array:
    Code:
    Public Shared Cells1 As Boolean(,)
    Public Shared Cells2 As Boolean(,)
    How do I set Cells2 equal to Cells1 but as a new instance? (So if I modify Cells2, Cells1 won't be affected.)
    Code:
    Cells2 = Cells1
    sets both arrays to the same instance,
    Code:
    Cells2 = New Boolean(,) {Cells1}
    gives me a syntax error, and
    Code:
    Cells2 = New Boolean(,) {}
    Cells2 = Cells1
    acts like the first string of code.

    How do I get this to work as expected? Thanks in advance.
    ~Nic

  2. #2
    Fanatic Member PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Newport, UK
    Posts
    519

    Re: How to create a new instance of the same array?


Tags for this Thread

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.