473,508 Members | 2,032 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

"John Brock" <jb****@panix.comwrote in message
news:gf**********@reader1.panix.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
Nov 20 '08 #1
2 1734
"Michael C" <mi**@nospam.comschrieb
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

Nov 20 '08 #2
"Armin Zingler" <az*******@freenet.dewrote in message
news:Op*************@TK2MSFTNGP02.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
Nov 21 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2160
by: Willem | last post by:
Looking for some opinions on alternatives to programming with Access. I find that quite often I need to loop through my recordsets (first to last) performing calculations and was wondering if...
3
4190
by: trevorelbourne | last post by:
Hi, I am having trouble accessing the elements of an array using reflection. This is the code I am having trouble with: FieldInfo Fields = Obj.GetType().GetFields(); foreach (FieldInfo fi in...
4
2625
by: Amy | last post by:
Hello, I've been struggling to learn C#.NET for a while now. I've made some progress, but I'm easily stumped. :( What's stumping me today is this: I've got a stored procedure (SQL) that...
2
4523
by: Peter Proost | last post by:
Hi group I have the following piece of code that should resize the bitmap in a picture box but it doesn't work as I tought it would. Can someone help me with it? thnx Peter Public Class...
3
4280
by: bill | last post by:
All, I have the following: ...... unsafe public struct Example { public double we;
9
12775
by: mps | last post by:
I want to define a class that has a generic parameter that is itself a generic class. For example, if I have a generic IQueue<Tinterface, and class A wants to make use of a generic class that...
10
6086
by: jimmy | last post by:
Hi again, sorry for posting two questions so close together but im working on a school project which is due in soon and running into some difficulties implementing the database parts. I have the...
1
4874
by: Richard Harter | last post by:
On Fri, 27 Jun 2008 09:28:56 -0700 (PDT), pereges <Broli00@gmail.comwrote: There are some obvious questions that should be asked, e.g., is the contents of your array already sorted as your...
2
1562
by: Michael C | last post by:
"John Brock" <jbrock@panix.comwrote in message news:gfvqmb$70j$2@reader1.panix.com... Perl isn't that strict a language, you might find a few things a little more difficult in dot net. That...
0
7226
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7125
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7328
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7388
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7499
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5055
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3199
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3186
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
422
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.