473,473 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

substitute for redim

redim may no longer be used in vb.net ...

is there another way to change at the runtime the lower & upper bounds of an
array ?
Nov 20 '05 #1
8 4672
John:

Redim is still available, as is Redim Preserve. The onlly limitation I was
aware of is that you can't change the number of dimensions in the array ie
you can redim all you want as long as you don't add or subtract the number
of dimensions in the array.
"John A Grandy" <johnagrandy-at-yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
redim may no longer be used in vb.net ...

is there another way to change at the runtime the lower & upper bounds of an array ?

Nov 20 '05 #2

"John A Grandy" <johnagrandy-at-yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
redim may no longer be used in vb.net ...

is there another way to change at the runtime the lower & upper bounds of an array ?

As far as I've seen, Redim is the beast still.......

Sueffel
Nov 20 '05 #3
"John A Grandy" <johnagrandy-at-yahoo.com> schrieb
redim may no longer be used in vb.net ...
Why?
is there another way to change at the runtime the lower & upper
bounds of an array ?


You can not change the bounds at all because array sizes are fixed. Lower
bound is always 0. You can create a new array using redim. You can also use

dim x as integer()={1, 2, 3, 4}

or

dim x as integer()

x = new integer(){1, 2, 3, 4}
to create a new integer array with upper bound = 3.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #4
* "John A Grandy" <johnagrandy-at-yahoo.com> scripsit:
redim may no longer be used in vb.net ...
Are you sure you are using Microsoft Visual Basic .NET?
is there another way to change at the runtime the lower & upper bounds of an
array ?


'ReDim', 'ReDim Preserve'. Notice that the commands have changed a
little bit.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bu************@ID-208219.news.uni-berlin.de...
* "John A Grandy" <johnagrandy-at-yahoo.com> scripsit:
redim may no longer be used in vb.net ...


Are you sure you are using Microsoft Visual Basic .NET?


hehe... herfried, always the wisenhieimer. =)

is there another way to change at the runtime the lower & upper bounds of an array ?


'ReDim', 'ReDim Preserve'. Notice that the commands have changed a
little bit.

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

Nov 20 '05 #6
<<<
You can create a new array using redim.

how ?

"Armin Zingler" <az*******@freenet.de> wrote in message
news:ev**************@TK2MSFTNGP12.phx.gbl... "John A Grandy" <johnagrandy-at-yahoo.com> schrieb
redim may no longer be used in vb.net ...
Why?
is there another way to change at the runtime the lower & upper
bounds of an array ?


You can not change the bounds at all because array sizes are fixed. Lower
bound is always 0. You can create a new array using redim. You can also

use
dim x as integer()={1, 2, 3, 4}

or

dim x as integer()

x = new integer(){1, 2, 3, 4}
to create a new integer array with upper bound = 3.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #7
"John A Grandy" <johnagrandy-at-yahoo.com> schrieb
<<<
You can create a new array using redim.


how ?

dim a() as integer

redim a(5)

Redim creates a new array of 6 integers (index 0 to 5).
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #8
Cor
Hi John,

Have a look at the arraylist, you are asking about old parts in VB, one
think that better can be replaced in your program are the old type dynamic
arrays

When it are fixed array's it is fine to use them, but when they become
dynamic, it is good to look to another solution, and from that is the
arraylist the most simple one.

I hope this helps?

Cor
Nov 20 '05 #9

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

Similar topics

4
by: Trevor Fairchild | last post by:
I've got a program that parses text files. The text files come to me in Unicode and they contain goofy characters that VB chokes on - treats them as eof markers. I have already been through this...
2
by: Wayne Wengert | last post by:
I am trying to add one column to an existing array (code below). The ReDim command gives the error: ----------------------------------------------- Microsoft VBScript runtime error '800a0009' ...
2
by: | last post by:
Is it correct to think that after reducing the populated array's size from say, 10 to 5 with redim preserve myArray(i) an attempt to access an element above the fifth does not cause a...
4
by: Daryl Davis | last post by:
I am having trouble with ReDim (see code below) SaleTable2's structure includes an array for SaleDetailTable2 Dim newsale As New hallsales.SaleTable2 Dim detail As New hallsales.SaleDetailTable2...
5
by: Zenobia | last post by:
Hello, I want to keep a list references to database records being accessed. I will do this by storing the record keys in a list. The list must not contain duplicate keys. So I check the...
9
by: John A Grandy | last post by:
In VB6 you could get away with the following code: Dim Index As Integer Dim ItemsCount As Integer Dim StringArray() As String Dim StringValue As String '....
5
by: Paul | last post by:
Off the cuff, does anyone know if arraylist is more efficeint at adding items to an array than redim preserve? Paul <begin loop> Dim c As Integer = SomeArray.GetUpperBound(0) + 1 ReDim...
19
by: Tom Jastrzebski | last post by:
Hello, I was just testing VB.Net on Framework.Net 2.0 performance when I run into the this problem. This trivial code attached below executed hundreds, if not thousand times faster in VB 6.0...
2
by: MLH | last post by:
How can I accomplish what I'm obviously trying to do below in a Sub procedure? Select Case CustomerCount Case Is < 10 Dim My_Targets(0 To 10) As String Case Is < 50 Dim My_Targets(0 To 50) As...
0
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
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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
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.