Connecting Tech Pros Worldwide Help | Site Map

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

  #1  
Old November 20th, 2008, 10:55 AM
Michael C
Guest
 
Posts: n/a
"John Brock" <jbrock@panix.comwrote in message
news:gfvqmb$70j$2@reader1.panix.com...
Quote:
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.
Quote:
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


  #2  
Old November 20th, 2008, 11:55 AM
Armin Zingler
Guest
 
Posts: n/a

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


"Michael C" <mike@nospam.comschrieb
Quote:
Quote:
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

  #3  
Old November 21st, 2008, 08:25 AM
Michael C
Guest
 
Posts: n/a

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


"Armin Zingler" <az.nospam@freenet.dewrote in message
news:OpTAQVwSJHA.408@TK2MSFTNGP02.phx.gbl...
Quote:
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.
Quote:
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


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Is there a way to resize an array from inside a procedure? Using Reflection maybe? Michael C answers 2 November 21st, 2008 08:25 AM
Re: Is there a way to resize an array from inside a procedure? Using Reflection maybe? Armin Zingler answers 0 November 19th, 2008 02:25 AM
Re: Is there a way to resize an array from inside a procedure? Using Reflection maybe? Michael C answers 0 November 18th, 2008 01:05 PM
Re: Is there a way to resize an array from inside a procedure? Using Reflection maybe? Michael C answers 0 November 18th, 2008 01:05 PM