Please Help! Dynamic Allocation of array of structures

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • RBCC

    Please Help! Dynamic Allocation of array of structures

    Does anyone know how to dynamically allocate array of structures? Or where
    Ican find info on this on the web? John
  • Tom Shelton

    #2
    Re: Please Help! Dynamic Allocation of array of structures

    On 2004-01-23, RBCC <putgarbagehere @email.com> wrote:[color=blue]
    > Does anyone know how to dynamically allocate array of structures? Or where
    > Ican find info on this on the web? John[/color]

    Check out ReDim...

    --
    Tom Shelton [MVP]

    Comment

    • Tom Shelton

      #3
      Re: Please Help! Dynamic Allocation of array of structures

      On 2004-01-23, RBCC <putgarbagehere @email.com> wrote:[color=blue]
      > Does anyone know how to dynamically allocate array of structures? Or where
      > Ican find info on this on the web? John[/color]


      Oh, or better yet - if possible - change your structures to classes and
      use an ArrayList...

      --
      Tom Shelton [MVP]

      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: Please Help! Dynamic Allocation of array of structures

        * RBCC <putgarbagehere @email.com> scripsit:[color=blue]
        > Does anyone know how to dynamically allocate array of structures? Or where
        > Ican find info on this on the web? John[/color]

        'ReDim Preserve'...

        --
        Herfried K. Wagner [MVP]
        <http://www.mvps.org/dotnet>

        Comment

        • Jose Caliente

          #5
          Re: Please Help! Dynamic Allocation of array of structures

          why classes? when a struct will do

          jc

          "Tom Shelton" <tom@mtogden.co m> wrote in message
          news:eEnbhBY4DH A.2648@tk2msftn gp13.phx.gbl...[color=blue]
          > On 2004-01-23, RBCC <putgarbagehere @email.com> wrote:[color=green]
          > > Does anyone know how to dynamically allocate array of structures? Or[/color][/color]
          where[color=blue][color=green]
          > > Ican find info on this on the web? John[/color]
          >
          >
          > Oh, or better yet - if possible - change your structures to classes and
          > use an ArrayList...
          >
          > --
          > Tom Shelton [MVP][/color]


          Comment

          • Jay B. Harlow [MVP - Outlook]

            #6
            Re: Please Help! Dynamic Allocation of array of structures

            Jose,
            Because structs will be boxed when you put them into an ArrayList, making it
            slightly more difficult to update them.

            Classes will not be boxed when they are put into the ArrayList as they are
            already reference types, so they are easier to work within an ArrayList.

            Remember that an ArrayList is designed to hold Objects (reference types).

            Hope this helps
            Jay

            "Jose Caliente" <jc@noble.net > wrote in message
            news:%23NJ9Dos4 DHA.1636@TK2MSF TNGP12.phx.gbl. ..[color=blue]
            > why classes? when a struct will do
            >
            > jc
            >
            > "Tom Shelton" <tom@mtogden.co m> wrote in message
            > news:eEnbhBY4DH A.2648@tk2msftn gp13.phx.gbl...[color=green]
            > > On 2004-01-23, RBCC <putgarbagehere @email.com> wrote:[color=darkred]
            > > > Does anyone know how to dynamically allocate array of structures? Or[/color][/color]
            > where[color=green][color=darkred]
            > > > Ican find info on this on the web? John[/color]
            > >
            > >
            > > Oh, or better yet - if possible - change your structures to classes and
            > > use an ArrayList...
            > >
            > > --
            > > Tom Shelton [MVP][/color]
            >
            >[/color]


            Comment

            Working...