Re: Is there a way to resize an array from inside a procedure? Using Reflection maybe?

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

    Re: Is there a way to resize an array from inside a procedure? Using Reflection maybe?

    "John Brock" <jbrock@panix.c omwrote in message
    news:gfvqmb$70j $2@reader1.pani x.com...
    This is something which is trivially easy in Perl, and, IMO, ought
    to be easy in any well designed language. If you can't come up
    with a one line example, then a two or three line example would
    also be welcome. Actually, I'd be interested in seeing how you
    would handle this situation if it came up in your own code.
    Perl isn't that strict a language, you might find a few things a little more
    difficult in dot net.
    Don't tell me though that I ought to be using lists instead of
    arrays.
    That is the best advice, if you want to ignore it then go ahead. What dot
    net calls an array is a fixed block of memory and a fixed block of memory
    has been difficult to resize since the beginning of computers. I think it's
    actually better that dot net doesn't hide this from the programmer. IMO they
    shouldn't even have had the redim or redim preserve statements, C# doesn't
    have these which is for the better.

    Michael


  • Armin Zingler

    #2
    Re: Is there a way to resize an array from inside a procedure? Using Reflection maybe?

    "Michael C" <mike@nospam.co mschrieb
    Don't tell me though that I ought to be using lists instead of
    arrays.
    >
    That is the best advice, if you want to ignore it then go ahead.
    What dot net calls an array is a fixed block of memory and a fixed
    block of memory has been difficult to resize since the beginning of
    computers. I think it's actually better that dot net doesn't hide
    this from the programmer. IMO they shouldn't even have had the redim
    or redim preserve statements, C# doesn't have these which is for the
    better.
    Regarding VB, Redim Preserve is probably only there for historic reasons
    (VB6 etc) where there was no sort of List (apart form the untyped
    Collection) - maybe also because upgraded projects should still work as good
    as possible. Well, some people complained that not everything has been taken
    over from VB6, some people complained that not everything has been dropped.
    So, if you consider the situation that MSFT was in, I think they made a good
    compromise. Anyway, that's history. BTW, I've never used Redim Preserve in
    VB.Net (IIRC).


    Armin

    Comment

    • Michael C

      #3
      Re: Is there a way to resize an array from inside a procedure? Using Reflection maybe?

      "Armin Zingler" <az.nospam@free net.dewrote in message
      news:OpTAQVwSJH A.408@TK2MSFTNG P02.phx.gbl...
      Regarding VB, Redim Preserve is probably only there for historic reasons
      (VB6 etc) where there was no sort of List (apart form the untyped
      Collection) - maybe also because upgraded projects should still work as
      good as possible. Well, some people complained that not everything has
      been taken over from VB6, some people complained that not everything has
      been dropped.
      Hehe, I know what you mean, they can't win either way :-) I'm definately
      from the camp that would like all the VB6 stuff gone, which is probably why
      I prefer C# because there is more of a departure from VB6.
      So, if you consider the situation that MSFT was in, I think they made a
      good compromise. Anyway, that's history. BTW, I've never used Redim
      Preserve in VB.Net (IIRC).
      I don't think VB6 ported over to dot net well at all so leaving redim
      preserve in or out wouldn't have made that much difference. IMO of course
      :-)

      Michael


      Comment

      Working...