07-17-2024, 12:09 PM
The function of Redim has been discussed ad nauseam here, but somehow it doesn't seem to get through.
Again: A static array is set to zero with Erase. That's all you need. Redim cannot be used here.
A dynamic array is reinitialized with Redim; the dimension cannot be changed. Two-dimensional to three-dimensional is not possible. If Erase is used on a dynamic array, you can't see anything, absolutely nothing, because a dynamic array only exists while the program is running. That's why you can't set it to zero! Erase frees up the array's memory space again; that doesn't work with static arrays.
Redim: Is a combination of Erase and Dim. Without Redim, you would first have to erase a dynamic array with Erase and then reinitialize it with Dim.
Again: A static array is set to zero with Erase. That's all you need. Redim cannot be used here.
A dynamic array is reinitialized with Redim; the dimension cannot be changed. Two-dimensional to three-dimensional is not possible. If Erase is used on a dynamic array, you can't see anything, absolutely nothing, because a dynamic array only exists while the program is running. That's why you can't set it to zero! Erase frees up the array's memory space again; that doesn't work with static arrays.
Redim: Is a combination of Erase and Dim. Without Redim, you would first have to erase a dynamic array with Erase and then reinitialize it with Dim.

