Question:

Microsoft Visual Basic?

by  |  earlier

0 LIKES UnLike

Hi. Simple question really for those who know how.

I am use to programming in JAVA. In JAVA i would use the code below to make a new instance of an array (well close to):

Array2 = new Array1;

I have tries to do this in VB and it does not work. Does VB have this ability.... if so what is the code?

 Tags:

   Report

1 ANSWERS


  1. Well VB can sort of do this, but you have to have Array2 defined already, and it must be the same type as Array1 (e.g. if Array1 is an Integer array, Array2 must also be defined as an Integer array). The following code should work:

    dim Array2() as Integer ' or whatever type you want

    ...

    Array2 = Array1

    This will make Array2 an exact copy of Array1. Hope this helps!

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.