Re: how to make array of arrays?

From: Jay B. Harlow [MVP - Outlook] (Jay_Harlow_MVP_at_msn.com)
Date: 09/27/04


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
>
>



Relevant Pages

  • how to make array of arrays?
    ... I created a structure ABC and an array of type ABC ... Public ABC1 As New ABC, ... Now I want to place arrABC1 and arrABC2 into an array. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Index / match combination
    ... Try this, array entered: ... Microsoft Excel MVP ... "ABC" in Column A to find. ... again an array formula. ...
    (microsoft.public.excel.misc)
  • Re: how to make array of arrays?
    ... you defined an array of ABC, not an array of array of ABC. ... > I created a structure ABC and an array of type ABC ... > Dim str1 As String ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Combinations problem
    ... the array then walk it and collapse it down to one instance ... That should ring ... Thus all you have to do is enumerate ...
    (comp.lang.c)
  • Re: File parsing
    ... Build an array or associatiave array... ... I can NOT read until the next occurance ot "abc"- abc 5 ...
    (comp.lang.awk)

Loading