rmatthew Posted January 9, 2003 Posted January 9, 2003 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) Quote
*Gurus* divil Posted January 9, 2003 *Gurus* Posted January 9, 2003 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. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
rmatthew Posted January 10, 2003 Author Posted January 10, 2003 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 :( Quote
Moderators Robby Posted January 10, 2003 Moderators Posted January 10, 2003 As Divil mentioned... dim shs() as integer redim preserve shs(x) Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.