Skip to main content

Erase statement (LotusScript Language)

Deletes an array, list, or list element.

Syntax

Erase { arrayName | listName | listName **** ( **** tag **** ) } [, { **** arrayName | listName | listName ( **** tag **** ) } ]...

Elements

arrayName

An array or a Variant variable containing an array. arrayName can end with empty parentheses.

listName

A list or a Variant variable containing a list. listName can end with empty parentheses.

tag

The list tag of a list element to be erased from the specified list.

Usage

The following table shows how the Erase statement affects arrays and lists.

ItemEffect of Erase statement
Fixed arrayIts elements are reinitialized.
Dynamic arrayLotusScript® removes all elements from storage and recovers the storage. The array retains its type, but has no elements.
You must use ReDim to redeclare the array before referring to its elements again. If you used ReDim before it was erased, the array maintains the same number of dimensions.
ListLotusScript® removes all elements from storage and recovers the storage. The list retains its type, but has no elements.
List elementThe element no longer exists in the list.

Example