Caché Basic Reference
Erase
[Home] [Back] [Next]
InterSystems: The power behind what matters   
Class Reference   
Search:    

Removes the named variable and deallocates dynamic-array storage space.
Synopsis
Erase varname
Arguments
The Erase statement has the following argument:
varname The name of the variable to be erased.
Description
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.
Examples
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
The following example uses Erase to specify an explicitly undefined placeholder variable:
  Erase blankvar
  tStatement = New %SQL.Statement(blankvar,"Sample")
  PrintLn "Success"
 
See Also