S
Steve
Hello,
I created a structure ABC and an array of type ABC
Public Structure ABC
Dim str1 As String
Dim int1 As Integer
End Structure
Public ABC1 As New ABC, ABC2 As New ABC
Public ABC3 As New ABC, ABC4 As New ABC
Public arrABC1() As ABC = {ABC1, ABC2}'--this array OK
Public arrABC2() As ABC = {ABC3, ABC4}'--this array OK
Now I want to place arrABC1 and arrABC2 into an array.
How to do this? I tried
Public arrABC() As ABC = {arrABC1(1), arrABC2(1)}'--ok
and call it like this
....arrABC(0)(0) to access structure ABC1 -- Not OK here
but I get an error message that I can't do this because
Structure ABC has no default property (option strict on -
must remain on). I could either add a default property to
the structure (how do you do that?) or I could use a
different kind of array type object. I have tried
ArrayList, but that did not work. I tried an Object()
array, but that did not work. Any suggestions appreciated.
Thanks,
Steve
I created a structure ABC and an array of type ABC
Public Structure ABC
Dim str1 As String
Dim int1 As Integer
End Structure
Public ABC1 As New ABC, ABC2 As New ABC
Public ABC3 As New ABC, ABC4 As New ABC
Public arrABC1() As ABC = {ABC1, ABC2}'--this array OK
Public arrABC2() As ABC = {ABC3, ABC4}'--this array OK
Now I want to place arrABC1 and arrABC2 into an array.
How to do this? I tried
Public arrABC() As ABC = {arrABC1(1), arrABC2(1)}'--ok
and call it like this
....arrABC(0)(0) to access structure ABC1 -- Not OK here
but I get an error message that I can't do this because
Structure ABC has no default property (option strict on -
must remain on). I could either add a default property to
the structure (how do you do that?) or I could use a
different kind of array type object. I have tried
ArrayList, but that did not work. I tried an Object()
array, but that did not work. Any suggestions appreciated.
Thanks,
Steve