hipturtle
Well-known member
- Joined
- Dec 1, 2011
- Messages
- 59
- Programming Experience
- 10+
Hello I am creating a dll with all the functions and subroutines that I use all the time and I decided to create a function that I can pass different types of array to so the function obviously (or not) would have an array of type object. Now I no you can pass any type into an object type but when I pass an integer array into an object array I get an error.
value of type '1-dimensional array of integer' cannot be converted to '1-dimensional array of object' because 'integer' is not a reference type.
Now is there any way I can do what I want to do. I have search the internet for an answer but can't find one, I would appreciate any help given on this subject.
Below is an example of my dilemma.
Shared Function CompareArray(ByVal FirstArray() As Object, ByVal SecondArray() As Object, Optional ByRef ErrorMessage As String = "") As Boolean
Dim IntArrayOne() As Integer = {1,2,3,4,5}
Dim IntArrayTwo() As Integer = {1,2,3,5,6}
Dim IsSame As Boolean = False
IsSame = CompareArray(IntArrayOne(), IntArrayTwo())
Thanks in advance
value of type '1-dimensional array of integer' cannot be converted to '1-dimensional array of object' because 'integer' is not a reference type.
Now is there any way I can do what I want to do. I have search the internet for an answer but can't find one, I would appreciate any help given on this subject.
Below is an example of my dilemma.
Shared Function CompareArray(ByVal FirstArray() As Object, ByVal SecondArray() As Object, Optional ByRef ErrorMessage As String = "") As Boolean
Dim IntArrayOne() As Integer = {1,2,3,4,5}
Dim IntArrayTwo() As Integer = {1,2,3,5,6}
Dim IsSame As Boolean = False
IsSame = CompareArray(IntArrayOne(), IntArrayTwo())
Thanks in advance