Re: Is there a way to resize an array from inside a procedure? Using Reflection maybe?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael C

    Re: Is there a way to resize an array from inside a procedure? Using Reflection maybe?

    "John Brock" <jbrock@panix.c omwrote in message
    news:gftga1$f9a $1@reader1.pani x.com...
    For that matter, does VB.NET already have the equivalent of Splice()
    somewhere, which, for example, would allow me to insert an element
    into the middle of an array, without having to jump though hoops?
    I have never understood why it is so awkward to manipulate arrays
    in VBA and VB.NET! Does anyone have any idea why, after all this
    time, this hasn't been fixed?
    The problem is not VB, it's your approach. The array is a fixed size block
    of memory as Armin pointed out. You should be using one of the many
    collection classes if you want to insert items in the middle of a list. Most
    likely the List class is what you need as it has an insert method. The list
    class is generic so can be created as type string

    Dim list as New List(Of String)
    list.add("Aa")
    list.add("ba")
    list.add("va")
    list.add("da")
    list.Insert("aa aa", 3")

    Michael


Working...