Re: how to make array of arrays?
From: Jay B. Harlow [MVP - Outlook] (Jay_Harlow_MVP_at_msn.com)
Date: 09/27/04
- Next message: moondaddy: "Re: Need regular expression to parse string"
- Previous message: raaco: "Re: Moving from VB6 to dot net"
- In reply to: Steve: "how to make array of arrays?"
- Next in thread: Steve: "Re: how to make array of arrays?"
- Reply: Steve: "Re: how to make array of arrays?"
- Reply: Jay B. Harlow [MVP - Outlook]: "Re: how to make array of arrays?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 27 Sep 2004 11:10:40 -0500
Steve,
> Public arrABC() As ABC = {arrABC1(1), arrABC2(1)}'--ok
No! you defined an array of ABC, not an array of array of ABC. arrABC has
ABC1 & ABC3 in it.
Try:
Public arrABC()() As ABC = {arrABC1, arrABC2}
Then will work:
Dim a As ABC = arrABC(0)(0)
Hope this helps
Jay
"Steve" <anonymous@discussions.microsoft.com> wrote in message
news:45e801c4a4a8$f8895fb0$a601280a@phx.gbl...
> 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
- Next message: moondaddy: "Re: Need regular expression to parse string"
- Previous message: raaco: "Re: Moving from VB6 to dot net"
- In reply to: Steve: "how to make array of arrays?"
- Next in thread: Steve: "Re: how to make array of arrays?"
- Reply: Steve: "Re: how to make array of arrays?"
- Reply: Jay B. Harlow [MVP - Outlook]: "Re: how to make array of arrays?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|