OK I have a control that loads a file into a public array, and then uses it to display a sprite to the screen and then its done with it. So how can I undim the array or something to make it no longer take up memory?
Printable View
OK I have a control that loads a file into a public array, and then uses it to display a sprite to the screen and then its done with it. So how can I undim the array or something to make it no longer take up memory?
If it is dynamic, you could redim it
You can use Erase statement:
Erase DynamicArray ' Free memory used by array
"When Erase statement is used with a Dynamic array, the memory allocated to the array is also freed. This brings the array to the state it was in after the execution of the statement
Dim DynamicArray()
After erasing a Dynamic array, you must redimension it with the ReDim staement. The ReDim statement could also change the dimensions of the array, as if it had never been used before."