with a ONE dimesional array you can tell if it has been allocated by doing this
if myarray.ubound<0 then [it has not been dimensioned]
So how do you do it with a 2D array?
if myarray.ubound(0)<0 then ' gives an compile error [This array method works only for one-dimensional arrays]
and this
if ubound(myarray,0)<0 then ' gives an out of bounds exception... EVEN if it is dimensioned already
Basically it is a 2D array of booleans… that will have a dynamic size that will change as the program is used…
The idea is to redim it to (-1,-1) and let the routine that updates it decide it it needs to reallocate a new one…
This way when the routine completes, it can “destroy” the array by setting it back to -1,-1
Note : the array is GLOBAL, as there are multiple routines that need to check the flags stored within