FutureBasic Logo

<<    Index    >> FutureBasic

DynamicClear   statement



Syntax
DynamicClear( gMyDynamicArray )

Description
Without deallocating the dynamic array's memory, DynamicClear clears the array to zeros from index zero through the highest index accessed by user code.
gMyDynamicArray is any FutureBasic Dynamic Array previously dimensioned using dynamic or dim dynamic.

Notes
1. DynamicClear won't clear an unallocated array. An array will be cleared if it was accessed and populated via at least one array index.
2. DynamicClear's behavior is different from Kill Dynamic's behavior which frees/deallocates the arrays memory.
Depending on an app's processing requirements, either Kill Dynamic or DynamicClear produces the same effective result. However, assuming the app needs to continue using the array, clearing omits a deallocation and reallocation which could be important for speed-sensitive situations.


See also
DynamicInsertItems; fn DynamicNextElement; DynamicRemoveItems; kill dynamic; read dynamic; write dynamic