RESET statement

Purpose

Set a scalar (non-array) 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).

Syntax

RESET variable [, ...]

RESET array() [, ...]

RESET array(index) [, ...]

Remarks

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, the first byte is set to nul ($NUL).  If variable is a fixed-length string or User-Defined Type/Union, 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 arrays, clearing the contents to zeroes or empty strings.  For more information on absolute arrays, please refer to the DIM statement.

See also

ARRAYATTR, DIM, ERASE, LET, LET (with Types), LET (with Variants), REDIM