Navigation:  thinBasic language > Data types and variables >

RESET

Previous pageReturn to chapter overviewNext page

 

Description

 

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).

 

Syntax

 

RESET variable [, ...]

RESET array() [, ...]

RESET array(index) [, ...]

 

Returns

 

None

 

Parameters

 

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, 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.

 

Restrictions

 

See also

 

Dim

 

Examples

 

 

 

 

© 2004-2008 thinBasic. All rights reserved. Version 1.7.0.0 Web Site: http://www.thinbasic.com