substitute for redim

  • Thread starter Thread starter John A Grandy
  • Start date Start date
J

John A Grandy

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 ?
 
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 said:
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.
 
John A Grandy said:
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
 
* "John A Grandy said:
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.
 
John A Grandy said:
<<<
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).
 
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
 
Back
Top