473,378 Members | 1,594 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 1728
"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
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
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
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
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
by: bill | last post by:
All, I have the following: ...... unsafe public struct Example { public double we;
9
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
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
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
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.