Insert an Element Into an Array without Looping 2
Category:Lists, Collections and Arrays
Version Compatibility: Visual Basic 6, Visual Basic 5
Updated and Simplified: Use the example below to allow you to insert one or more elements into the middle of an array without the need to loop through each element in the array. You can modify the routine to support any structure or variable type by simply changing the declaration. This can improve performance when manipulating large arrays. Thanks to Davide Di Loreto for helping to debug this code.
Instructions: Copy the declarations and code below and paste directly into your VB project.