Navigation:  ThinBASIC Language > Data types and variables >


Previous pageReturn to chapter overviewNext page




Set a scalar variable, Variant, User-Defined Type, individual array element (or an entire array) to zero or null/empty.  RESET does not deallocate the actual memory used (with the exception of dynamic string array data, which is automatically deallocated).




RESET variable [, ...]

RESET array() [, ...]

RESET array(index) [, ...]










If variable is numeric, it is set to zero.

If variable is a dynamic string, it is set to null ("", an empty string).

If variable is an ASCIIZ string, all the bytes are set to nul ($NUL).

If variable is a fixed-length string all the bytes are set to spaces.

If variable is a User-Defined Type, all bytes in variable are set to $NUL, or CHR$(0).

If variable is a Variant, it is cleared and set to data type %VT_EMPTY.


If array() is numeric, all elements are set to zero; otherwise all elements are set to zero/null.

If an array index value is specified within the parentheses, just that array element is set to zero/null, as if it were a scalar (non-array) variable.


RESET also works with absolute variables (variables declared with DIM ... AT ... clause), following the same rules specified above.




See also