Jan 8, 2003 #1 R 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)
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)
Jan 9, 2003 #2 D divil Ultimate Contributor Joined Nov 17, 2002 Messages 2,746 Location England 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.
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.
Jan 10, 2003 #3 R rmatthew Centurion Joined Dec 30, 2002 Messages 115 Location Texas 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
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
Jan 10, 2003 #4 R Robby Ultimate Contributor Joined Nov 17, 2002 Messages 3,460 Location Montreal, Ca. As Divil mentioned... Visual Basic: dim shs() as integer redim preserve shs(x)