VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Redim multi-dimension array's rows

Miscellaneous   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

At times I need to redim a multi-dimension array by adding an extra row or rows, and keep the arrays contents. In VB you can only change the size of the last dimension in a multi-dimension array, this is ok if you want to only add columns. If you want to add a row to a multi-dimension array you can’t redim it and preserve the array’s data. To get around this problem I have created a process to do this for me. Just copy the contents of the multi-dimension array to another exact copy, multi-dimension temp array. Then redim the original array’s row up by one, and then copy the temp array back to the original. Now the original multi-dimension array still has its contents plus has an extra new row to add more data to!

Inputs
Input array.

Assumes
Need to know the facts about building and using arrays.

Returns
A redim multi-dimension array.

Side Effects
None.

Rate Redim multi-dimension array's rows (4(4 Vote))
Redim multi-dimension array's rows.bas

Redim multi-dimension array's rows Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters