BB___REDIM

=REDIM= toc

Description
> Changes the //size// of an array. An array that has been **DIM**ensioned to hold a certain number of elements can be **REDIM**ensioned to change the number of elements that it can hold.

Syntax

 * 1. redim //array(size)// || for one-dimensional array ||
 * 2. redim //array(size1, size2)// || for two-dimensional array ||

Hints
> REDIM erases any previous contents of an array and sets all of the elements to zero (0), or to an empty string ("") if it is a string array. Any data stored in the array before the REDIM must be read back into the array (re-stored) if it is still to be used.

> REDIM is useful if the number of data items your program needs to save to an array changes from the initial DIM size.

> You cannot change a one-dimension array to a two-dimension array (or vice versa) with REDIM.

Example
code format="vbnet" ' code snippet... dim cust$(10) 'dimension the array '   '    '    'when we know that there are 510 customers perform a REDIM redim cust$(510) 'all the data was erased from the array 'now read in the customer records code

Useful Functions
code format="vbnet" Place a useful function using this command here code