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: Herfried K. Wagner [MVP]: "Re: Sorting files by size"
- Previous message: Steve: "Re: how to make array of arrays?"
- In reply to: Jay B. Harlow [MVP - Outlook]: "Re: how to make array of arrays?"
- Next in thread: Cor Ligthert: "Re: how to make array of arrays?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 27 Sep 2004 11:32:46 -0500
Doh!
>> 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.
Damn based 0 indexes ;-) Your arrABC has ABC2 & ABC4 in it...
Glad you got it to work.
Hope this helps
Jay
"Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP@msn.com> wrote in message
news:u2eFkyKpEHA.3428@TK2MSFTNGP11.phx.gbl...
> 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: Herfried K. Wagner [MVP]: "Re: Sorting files by size"
- Previous message: Steve: "Re: how to make array of arrays?"
- In reply to: Jay B. Harlow [MVP - Outlook]: "Re: how to make array of arrays?"
- Next in thread: Cor Ligthert: "Re: how to make array of arrays?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|