System.Array (Redim)

rmatthew

Centurion
Joined
Dec 30, 2002
Messages
115
Location
Texas
I need to chane the size of a one dimensional System.Array
Redim does not work?

The code I have to send the itemids to requires a type of system.array

itemids = System.Array.CreateInstance(GetType(String), lengths, lbounds)
 
All arrays are of type System.Array. Why don't you declare it in the usual fashion?

Dim itemids() As String
ReDim itemids(x)

Gives you an array with x + 1 elements.
 
The reference code I am looking at does as so (I am looking at sample code for a OPC class). I can't seem to find a reference to this syntax????


lengths(0) = 3
lbounds(0) = 1
shs = System.Array.CreateInstance(GetType(Int32), lengths, lbounds)

What I did to replace this was:

dim shs(0) as integer

Then I redim preserve as I need to grow. Doesn't seem to work the right way though :(
 
Back
Top