Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new window

For information on migrating to InterSystems IRISOpens in a new window, see the InterSystems IRIS Migration Guide and Migrating to InterSystems IRIS, both available on the WRC Distributions pageOpens in a new window (login required).


Removes the named variable and deallocates dynamic-array storage space.


Erase varname


The Erase statement has the following argument:

varname The name of the variable to be erased.


The Erase statement removes the variable and all descended nodes.

Erase may be used to insure that a variable has no defined value, such as when a named variable is used as a placeholder in an argument list.


The following example uses Erase to remove an array and its subnodes:

array = "root node"
array("subnode") = "subnode"
array("subnode", "subnode") = "subnode, subnode"
Println Exists(array) 'returns 3; variable defined and has array elements
Erase array 
Println Exists(array) 'returns 0
Copy code to clipboard

The following example uses Erase to specify an explicitly undefined placeholder variable:

  Erase blankvar
  tStatement = New %SQL.Statement(blankvar,"Sample")
  PrintLn "Success"
Copy code to clipboard

See Also

FeedbackOpens in a new window