Dim and erase a public array at runtime
Posted on 2005-04-11
I am sure this may be quite basic, but am just returning to coding after many years and am stuck on the following issue, so any help would be much appreciated. I am writing a vb.net application that requires a large multi dimensional array which I have initially setup as a public array.
In order to release the memory used, I want to "erase" the array after use. However I may need to reuse the array, so how can I "dim" the array again at runtime, still making it public. I would not need any data retained.
For instance if the array is xx(100,200,50) is the best way for me to publically dim xx in the design phase and then after use at runtime release its memory using a redim xx(0,0,0) and then redim back to xx(100,200,50) if I need to reuse xx again.
Or is there a much easier way ?
Many thanks for your help